Re: [stack] recursive combinators in other languages
"Christopher Diggins" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
> Are there other languages that use the same form? Well this isn't so much a language property, as a feature of the standard library. Some languages make it easy to define combinators of that form, but they aren't idiomatic (Haskell for example). - Christopher On Sat, Mar 15, 2008 at 6:48 AM, Rahul <[email protected]> wrote: > I recently discovered that Nial (learning array languages because of > this list :) ) recursive transformers were remarkably similar to the > joy recursive combinators. > > The definition of factorial in Nial is given by > > factorial is recur [ 0 =, 1 first, pass, product, -1 +] > > the arguments to 'recur' are: > > test:checks that the argument meets an end condition, > endf:is applied to the end argument before starting to build the > result, > parta:left value computed from the argument and stacked, > joinf:combines the left and right values as the recursion unwinds, and > partb:gives the value to be recurred on to produce the right value. > > Are there other languages that use the same form? > > Rahul > >