Re: [stack] sweetening concatenative syntax
Stevan Apter <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
----- Original Message ----- From: <[email protected]> To: <[email protected]> Sent: Wednesday, March 05, 2008 9:03 PM Subject: Re: [stack] sweetening concatenative syntax > On Mar 5, 2008, at 5:26 PM, Stevan Apter wrote: > >> temperament, taste, and further imponderable subjectivities. > > Well, perhaps this is worth testing then. Here's how I'm suggesting one > could write a non-tail-recursive 'map' in terms of 'cons' and 'unlist': > > f map = unlist: > [] > [x xs -> (f x) (map xs f) cons] > >> i want my concatenativity neat, straight no chaser. > > How would you personally write this in a purely concatenative form? No > cheating by using combinators like 'fold'; you only get to use 'cons' (a > {a} -> {a}) and 'unlist' (A {b} [A -> C] [A b {b} -> C] -> C). my joy is so rusty these days. i'm on the wagon. in the g variant of my f language: [[dup!count![]top!]dip!swap! [[uncons!]dip!dup!top! [cons!unit!. first!swons!]dipd!] do!pop!pop!|] map "[..][f]map!" and in XY: ; map [jump] [each* rot => map <= swons] [pop] ifte ; ; each* => uncons <= tuck 2slip ; in both languages, all words are bottom out in symbolic primitives. six or seven for XY, rather more for g. details here: www.nsl.com. > > - John > >