Re: [stack] Fwd: [Factor-talk] cleave, 2cleave, and spread

John Nowak <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On Apr 3, 2008, at 6:24 PM, William Tanksley, Jr wrote:

> Slava, the author/primary author of the Factor language, writes:
>
> - cleave takes one value, and an array of quotations. It applies each
> quotation to the value; the value is removed from the stack  
> afterwards.
> - 2cleave takes two values, and an array of quotations. it applies
> each quotation to the two values; the two values are removed from the
> stack afterwards.

While cleave/2cleave do seem to form a possible base, they are  
impossible to type. That's not to say cleave isn't convenient, but for  
convenience alone you can always offer it as a macro that translates a  
statically-known list of functions to the same thing in terms of some  
simpler core set. I'd argue that using cleave with arrays not known at  
compile-time is very difficult for a human to reason about anyway and  
likely should be avoided in all cases.

- John
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.