Runtime evaluation: Difference between revisions
Content added Content deleted
Line 757: | Line 757: | ||
In order to restrict evaluation, perform is used on strings. With perform, only objects can be evaluated. If a function or a method is included into the string an exception is raised and the function is not evaluated. |
In order to restrict evaluation, perform is used on strings. With perform, only objects can be evaluated. If a function or a method is included into the string an exception is raised and the function is not evaluated. |
||
<lang Oforth>"[ [ $a, 12], [$b, 1.2], [ $c, [ $aaa, $bbb, $ccc ] ] ]" perform .s |
<lang Oforth>"[ [ $a, 12], [$b, 1.2], [ $c, [ $aaa, $bbb, $ccc ] ], [ $torun, #first ] ]" perform .s |
||
[1] (List) [[a, 12], [b, 1.2], [c, [aaa, bbb, ccc]]] |
[1] (List) [[a, 12], [b, 1.2], [c, [aaa, bbb, ccc]], [torun, #first]] |
||
"12 13 +" perform |
"12 13 +" perform |