Y combinator: Difference between revisions

Content added Content deleted
imported>HumptydumptyMe
(This is another take at Y-combinator in Forth.)
imported>HumptydumptyMe
mNo edit summary
Line 3,001: Line 3,001:
=={{header|Forth}}==
=={{header|Forth}}==
<syntaxhighlight lang="forth">
<syntaxhighlight lang="forth">
\ Begin of aproach. Depends on 'latestxt' word of GForth implementation.
\ Begin of approach. Depends on 'latestxt' word of GForth implementation.


: self-parameter ( xt -- xt' )
: self-parameter ( xt -- xt' )
Line 3,016: Line 3,016:
10 :noname ( u xt -- u' ) over 2 < if 2drop 1 exit then over 1- swap execute * ; Y execute . 3628800 ok
10 :noname ( u xt -- u' ) over 2 < if 2drop 1 exit then over 1- swap execute * ; Y execute . 3628800 ok


\ End of aproach.
\ End of approach.
</syntaxhighlight><syntaxhighlight lang="forth">\ Address of an xt.
</syntaxhighlight><syntaxhighlight lang="forth">\ Address of an xt.
variable 'xt
variable 'xt