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 7:02 PM, zallambo wrote:
> William Tanksley wrote:
>
>> Stevan Apter wrote:
>>
>>> John Nowak wrote:
>>>
>>>> What XY does seems even worse though! Here's why:
>>>> 1. [dup] i == [dup] first i (given, as per your example)
>>>> 2. [dup] == [dup] first (removing shared 'i' suffix)
>>>> 3. id == first (removing share '[dup]' prefix)
>>>
>>> no. dup = [dup] first.
>>
>> You're right, but he's also right -- you should always be able to
>> remove
>> identical suffixes from both sides of the equation, and in this
>> case you
>> can't do that.
>
> (2) does not follow from (1) and (3) does not follow from (2).
You're right. You can add prefixes/suffixes but not necessarily remove
them. I got my wires crossed somewhere along the way. My apologies.
> I think John has a point though. We need a way to distinguish between
> the function 'dup' and the object 'dup'. I suggest putting a single
> quote in front of objects, like symbols in Scheme. So
>
> [dup] i == dup
> [dup] first == 'dup
I think we need to be careful here. If we intend both sides of the
equality to be a function, then 'dup cannot be an object.
> Does anyone have another syntax for writing 'dup? I cannot recall
> seeing any.
In the initial email, I proposed using `dup to indicate the constant
function that returns dup. This would allow you to state the following:
[dup] first == `dup
It's important to note that '[dup] != `dup'. I proposed getting rid of
quotation to solve this issue. It obviously would be a big change for
Joy and XY. For something like Cat, it would be minor.
- John