Re: [stack] sweetening concatenative syntax

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

> John Nowak <[email protected]> wrote:
>> William Tanksley, Jr wrote:
>>> But in no case does this functionality REQUIRE
>>> lambdas or locals; why should it? All you're doing is  
>>> patternmatching.
>
>> I'm actively trying to avoid defining the language in terms of  
>> pattern
>> matching. Here, 'unlist' is just a normal function. But yes, of  
>> course
>> it doesn't require locals. You could do this as well:
>>    map = swap
>>          []
>>          [rot dup 2keep swap map cons]
>>        unlist
>
> ...but you're still doing patternmatching. Aren't you? What am I  
> missing?

'unlist' is just a normal function that gets defined as a result of  
declaring the 'list' data type:

    unlist :: A {b} [A -> C] [A b {b} -> C] -> C

This is different from general pattern matching as there's no way to  
match on particular values and "matching" here is guaranteed to be  
constant time. Alternatively, it isn't pattern matching as it doesn't  
involve patterns. The fact that it *looks* like pattern matching when  
lambda expressions are used is a very nice thing.

>

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