Runtime evaluation: Difference between revisions

no edit summary
(Added EchoLIsp)
No edit summary
Line 1,108:
right 50 bytes of result=···22977396345497637789562340536844867686961011228671
</pre>
 
=={{header|Ring}}==
<lang ring>
Eval("nOutput = 5+2*5 " )
See "5+2*5 = " + nOutput + nl
Eval("for x = 1 to 10 see x + nl next")
Eval("func test see 'message from test!' ")
test()
</lang>
Output :
<lang ring>
5+2*5 = 15
1
2
3
4
5
6
7
8
9
10
message from test!
</lang>
 
We can create simple interactive programming environment using the next program
<lang ring>
while true
see nl + "code:> "
give cCode
try
eval(cCode)
catch
see cCatchError
done
end
</lang>
 
Output
<lang ring>
code:> see "hello world"
hello world
code:> for x = 1 to 10 see x + nl next
1
2
3
4
5
6
7
8
9
10
 
code:> func test see "Hello from test" + nl
 
code:> test()
Hello from test
 
code:> bye
</lang>
 
=={{header|Ruby}}==