Re: [stack] sweetening concatenative syntax

John Nowak <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On Mar 6, 2008, at 5:52 PM, John Nowak wrote:

>    null?  = [true] [cons false] unlist

Wrong!

    null? :: {a} -> {a} bool
    null? = [null true] [cons false] unlist

Better. Alternatively, if you *don't* want to keep the list around:

    null? :: {a} -> bool
    null? = [true] [pop pop false] unlist

The first version makes a lot more sense in a linear language. The  
unconsing and consing can also be easily optimized out that way. Keep  
in mind that you never really use 'null?' if you have 'unlist' anyway.

- 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.