Re: [stack] function/object ambiguity + quotation alternative
John Nowak <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On Feb 27, 2009, at 1:29 PM, William Tanksley wrote:
>> The whole problem is that, in my opinion, "open" quotations suck. For
>> example, this rule always holds true in Cat:
>
> So you want to treat them differently because treating them
> differently
> sucks? :-)
It's more that I want to be consistent in treating them differently
since we *must* treat them differently once we have open quotations.
In Joy, no function treats them similarly that I know of. In XY, only
'i' seems to treat them similarly. I think this exception is a mistake.
> Yes, I agree that open quotations are a problem. If you don't have
> them,
> [dup] and `dup are equivalent by any test.
My main point though is that, without open quotations, you never need
to see the object dup on the stack in the first place! It avoids the
entire issue. Cat is a good example of how this can work.
> Quotations, whether open or closed, ARE "naked function objects".
By naked function objects, I specifically meant functions not in a
quotation. They cause the problem that '[dup] first' looks like it
would return 'dup', but '[dup] first' is not the same function as
'dup'. This causes problems when manipulating programs and is
precisely what I was trying to address in my initial email. Zallambo
has understood my point, but I think his solution of using (') to
denote an object is unsatisfactory because objects cannot be composed
and something like "'dup 42" looks like a function composition.
- John