Looking to switch jobs? Preparing for Euphoria Programming Language jobs? Then have a look at our interview questions page. Euphoria is a programming language originally created by Robert Craig of Rapid Deployment Software in Toronto, Ontario, Canada. Initially developed on the Atari ST, the first commercial release was for the 16-bit DOS platform and was proprietary. It is the one of the best job for our courier. There are many jobs available on wisdom jobs like counter sales executive, general sales manager, quality analyst, vice president, mean stack developer, web developer, retail stores accountant, HR, business development executive, personal secretary and field sales executive etc. visit our euphoria programming language jobs interview questions and answers page to win your job search.
Question 1. Is There A Tool To Help Find Bugs Or Perform Static Analysis?
Answer :
TEST (all) Parses the code only and issues any warnings or errors to STDOUT. On error the exit code will be 1, otherwise 0. If an error was found, the normal "Press Enter" prompt will not be presented when using the -TEST parameter which enables many editor/IDE programs to test the syntax of your Euphoria source in real time.
Question 2. How Do You Set A Global Variable In A Function?
Answer :
Assign a value to it.
Question 3. How Do I Share Global Variables Across Modules?
Answer :
Use the "global" variable definition.
Question 4. How Do I Write A Function With Output Parameters (call By Reference)?
Answer :
Euphoria doesn't support call by reference. If you want your function to modify a variable, assign the return value of the function to that variable.
Question 5. How Do I Copy An Object In Euphoria?
Answer :
a=b
Question 6. How Can I Find The Methods Or Attributes Of An Object?
Answer :
Euphoria isn't object oriented.
Question 7. How Can My Code Discover The Name Of An Object?
Answer :
Euphoria isn't an object oriented language.
Question 8. How Do I Specify Hexadecimal And Octal Integers?
Answer :
For hexadecimal, use the '#' symbol (#FE, #A000, etc.). It is not possible to input octal values, but it is possible to output them. See printf().
Question 9. How Do I Convert A String To A Number?
Answer :
Use the value() function.
Question 10. How Do I Convert A Number To A String?
Answer :
Use the sprint() orsprintf() function.
Question 11. How Do I Modify A String In Place?
Answer :
Just do it. name = "Abe Lincoln" name = "Abraham Lincoln"
Question 12. How Are Arguments Passed?
Answer :
All arguments are passed by value.
Question 13. Does The Value Of A Constant Ever Change?
Answer :
No. The value of a constant is fixed when it's defined for the life of the program.
Question 14. Does Euphoria Support Keyword Arguments?
Answer :
No. There are ways to simulate keyword arguments, however, using functions in the std library.
Question 15. What Does $ Mean?
Answer :
The symbol '$' in Euphoria version 2.5 and later means "length(of_sequence)."
sequence s, i
s = "My Sequence"
i = s[$] -- i = "e"
i = s[4..$] -- i = "Sequence"
i = s[$-5] -- i = "q"
Question 16. Does Euphoria Have Exception Handling?
Answer :
No.
Question 17. What's A Negative Index?
Answer :
Negative index is a mis-named feature of Python and some other languages. If the index is n, and n = -1, then this means, to python, in English, "the last". In Euphoria, this would be x[length(x)], or in a more convenient shorthand x[$]. In Python, -2 would mean "next to last". In Euphoria x[length(x)-1] or x[$-1].
Question 18. How Do I Iterate Over A Sequence In Reverse Order?
Answer :
Use a for..loop, like so
sequence s
for t=length(s) to 1 by -1 do
-- do something with s[t]
end for
Question 19. How Do You Make An Array In Euphoria?
Answer :
Sequences are arrays. You create them by first declaring a variable as sequence, then assigning elements to the sequence. For example
sequence s
s = { 1, 2, 3 } -- s is a 3-element sequence
s = repeat(0,20) -- s is a 20-element sequence of zeroes
s = repeat(repeat(1,10),20) -- s is a 20-element sequence of 10-element sequences
Question 20. How Do You Refer To Individual Elements In An Array?
Answer :
You get the value from a sequence with bracketed values. For instance,
?s[5][3] -- prints the third element of the fifth sequence (a multi-dimensional sequence)
Question 21. I Want To Do A Complicated Sort: Can You Do A Schwartzian Transform In Euphoria?
Answer :
The term "Schwartzian transform" is the perl name for a sorting algorithm which can be written in almost any turing-complete programming language, including Euphoria. Euphoria is likely to be faster than perl.
Question 22. How Can I Process A File And Update Its Contents?
Answer :
One way to do this is:
Question 23. Should I Feel Uneasy If I Don't Close A File?
Answer :
You should always close any files you no longer need open. However, Euphoria will automatically close any still-open files when your program terminates.
Question 24. How Can I Control Output Buffering?
Answer :
flush.
Question 25. How Can I Use A Library Written In C From Euphoria?
Answer :
You can access shared libraries from a Euphoria program.
You can use code from a shared library uing open_dll(libname). This returns an atom which you'll have to reuse to access individual variables or functions.
You can access a function in a previously opened shared library by calling define_c_function(entry_point,func_name,type_arglist,return_type). This return an id that you can use with call_func().
define_c_proc() and define_c_var() work in the same way, but require less arguments for obvious reasons. You can define a function as a procedure if you'll never care about the returned value. You can access executable machine code using the above. Use "" as an entry point, and the address as name.
You can call(address) so that code at address gets executed. The code must be a routine that returns using the near ret instructions (opcode #C3). All used registers must be restored upon return. You'll have to set up the memory area which you'll call() into by coding some machine code into a sequence, allocate() a memory block of the right size and poke()ing the sequence first.
You must be aware that the code will run in 32 bit protected mode at privilege 3, and that call() requires two task switches, penalizing performance unless the asm code has a lot of work to perform. (1)
Question 26. How Can I Count The Number Of Lines In A File?
Answer :
Here's one way:
include std/io.e
sequence fname = "GtkEngine.e"
object lines = read_lines(fname)
printf(1,"There are %d lines in file %sn",{length(lines),fname})
Question 27. How Can I Sum The Elements In An Array?
Answer :
Here's one way:
include std/math.e
sequence a = {1,2,3,4,5,6,7,8}
? sum(a)
Question 28. Is There A Cgi Module For Euphoria?
Answer :
There is no standard CGI module that gets distributed with the Euphoria base package. However, there is code available for doing CGI with Euphoria (obviously, because this entire website is being served by a Euphoria CGI program). You can also get specific information for running Euphoria as CGI here and at the official Euphoria web site.
Question 29. Does Euphoria Support Object Oriented Programming?
Answer :
Vanilla Euphoria does not "support" OO programming, though there are OO libraries in the archive, and Matthew Lewis has created a Euphoria interpreter with built-in object-oriented features.
Question 30. Why Does My Program Take Longer To Load?
Answer :
Symbol scope and resolution has changed in v4. Most v3 code will work correctly with respect to include files and global symbols, but if you use a global symbol without including the file in which it was defined (or another file that includes the correct file) then euphoria will take a little longer to resolve that reference. It is advised that if you use any variable or routine from some file or library, that each using file include the file or library that defines the symbols being used.
Euphoria Programming Language Related Tutorials |
|
---|---|
Go (programming language) Tutorial | D Programming Language Tutorial |
Lua (programming language) Tutorial |
Euphoria Programming Language Related Practice Tests |
|
---|---|
Principles of Programming Languages Practice Tests | Mac OS X Deployment Practice Tests |
Go (programming language) Practice Tests |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.