Runtime evaluation/In an environment: Difference between revisions

Content added Content deleted
(Add Factor example)
m (→‎{{header|Factor}}: fix a typo, demonstrate the non-global status of x)
Line 266: Line 266:
tuck
tuck
[ [ x ] dip [ ( -- y ) eval ] curry with-variable ] 2bi@ - ;</lang>
[ [ x ] dip [ ( -- y ) eval ] curry with-variable ] 2bi@ - ;</lang>
<lang factor>IN: scratchpad "x get dup * " eval-with-x .
<lang factor>IN: scratchpad 9 4 "x get dup * " eval-with-x .
65</lang>
65
IN: scratchpad x get .
f</lang>


=={{header|Forth}}==
=={{header|Forth}}==