Anonymous recursion: Difference between revisions
Content added Content deleted
(Addition of Fōrmulæ language) |
mNo edit summary |
||
Line 757: | Line 757: | ||
# To enable the recursion, a reference to the quotation stays on the stack. This ''q'' impedes access to other things on the stack. This solution must use <code>dip</code> and <code>swap</code> to move ''q'' out of the way. To simplify the code, one might move ''q'' to a local variable, but then the recursion would not be anonymous. |
# To enable the recursion, a reference to the quotation stays on the stack. This ''q'' impedes access to other things on the stack. This solution must use <code>dip</code> and <code>swap</code> to move ''q'' out of the way. To simplify the code, one might move ''q'' to a local variable, but then the recursion would not be anonymous. |
||
# Factor cannot infer the stack effect of a recursive quotation. The last line must have <code>call( n q -- m )</code> instead of plain <code>call</code>; but <code>call( n q -- m )</code> defers the stack effect check until runtime. So if the quotation has a wrong stack effect, the compiler would miss the error; only a run of <code>fib</code> would detect the error. |
# Factor cannot infer the stack effect of a recursive quotation. The last line must have <code>call( n q -- m )</code> instead of plain <code>call</code>; but <code>call( n q -- m )</code> defers the stack effect check until runtime. So if the quotation has a wrong stack effect, the compiler would miss the error; only a run of <code>fib</code> would detect the error. |
||
⚫ | |||
⚫ | |||
⚫ | Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text. Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation —i.e. XML, JSON— they are intended for transportation effects more than visualization and edition. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Falcon}}== |
=={{header|Falcon}}== |
||
Line 807: | Line 796: | ||
"/home/uDTVwo/prog.fam" prog.__main__:22(PC:132) |
"/home/uDTVwo/prog.fam" prog.__main__:22(PC:132) |
||
</pre> |
</pre> |
||
⚫ | |||
⚫ | |||
⚫ | Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text. Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation —i.e. XML, JSON— they are intended for transportation effects more than visualization and edition. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Forth}}== |
=={{header|Forth}}== |