Re: [stack] function/object ambiguity + quotation alternative

John Nowak <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On Feb 26, 2009, at 1:06 PM, Stevan Apter wrote:

> i see the problem.  in XY, [X]first != [X]i.
> i moves the top of the stack to the head of the queue, whence it  
> executes,
> immediately.
> first replaces the top of the stack with the first element of the  
> top of
> the stack.

Your assessment that the problem is '[X]first != [X]i' is incorrect.

Currently in XY, this is true:

    [dup] first i  ==  [dup] i

The problem is that this means I can prove that 'first' is the  
identity function.

If we change XY such that '[dup] first == [dup] i', I can take this:

    [dup] first i  ==  [dup] i

And substitute '[dup] i' for '[dup] first':

    [dup] i i  ==  [dup] i

And hence I can prove 'i i == i', and then from there prove that 'i'  
is the identity function.

The only way to solve this problem is to have '[dup] first i' cause an  
error. 'i' must be correctly restricted to performing "dequotation" as  
in Joy, Factor, Cat, etc.

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