Runtime evaluation: Difference between revisions

Added FreeBasic
m (Fix missing newline in output of lang example)
(Added FreeBasic)
Line 513:
restore
unused . \ same as first unused; restore, foo, and my-def no longer defined</syntaxhighlight>
 
=={{header|FreeBASIC}}==
<syntaxhighlight lang="vb">#macro assign(sym, expr)
__fb_unquote__(__fb_eval__("#undef " + sym))
__fb_unquote__(__fb_eval__("#define " + sym + " " + __fb_quote__(__fb_eval__(expr))))
#endmacro
 
#define a, b, x
 
assign("a", 8)
assign("b", 7)
assign("x", Sqr(a) + (Sin(b*3)/2))
Print x
 
assign("x", "goodbye")
Print x
 
Sleep</syntaxhighlight>
{{out}}
<pre> 3.246754944014219
goodby</pre>
 
=={{header|Frink}}==
2,122

edits