Re: [stack] adding construction to factor
John Nowak <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On Jan 4, 2009, at 6:12 PM, Christopher Diggins wrote: >> Probably it is >> difficult to read because you are unfamiliar with Factor's library. > > Of course I'm unfamiliar with Factor's library, this is not a Factor > mailing list. I have the expectation that my experience with Joy, > PostScript, combinatory logic, lambda calculus, over a dozen other > programming language plus my own concatenative language, should be > enough to figure out code posted to this list. Here's a Joy implementation: LIBRA reverse == [] [swons] fold; @N == [] swap [cons] times reverse; @2 == 2 @N; @3 == 3 @N; @4 == 4 @N; quote == [] cons; when == [] ifte; unless == [] swap ifte; lift == [list] [quote] unless; single == [null] [pop false] [uncons null popd] ifte; lower == [single] [first] when; over == [dup] dip swap; infralowermap == [over [infra] dip swap lower] map; construct == [lift] dip infralowermap popd [] step; . - John