Wednesday, May 17, 2006, 1:57:10 PM, Gregg wrote:

> Wednesday, May 17, 2006, 11:07:25 AM, Ladislav wrote:

>> But I (personally) don't think it is a good practice to use
>> nontransparent argument passing anywhere and don't see any
>> advantages of doing it. (nice flame bait, isn't it?)

> Excellent flame bait! :) I think the perceived advantage may have
> been usability, in not having to remember to use a lit-word! value.
> Of course, SET and GET require it, as do a few others.

I strongly agree with Ladislav, personally I dislike "nontransparent
argument passing" [1] in most of the cases. Personally I find it to be
of value in much used "console tools" such as 'source or 'help. In
most other functions I find it far more intuitive to that if a
function needs a literal word (a symbol) for something to actually
pass it a lit-word!. The same goes for higher-order functions which
take a function as an argument.

That's why I prefer

  collect 'emit [ ... ]

over

  collect emit [ ... ] .

Intuitively I see this the following way: the function 'collect needs
a label to use for a function it provides to the code-block passed as
second argument. So passing it a lit-word! is more natural and more
self-documenting in my opinion.

A reader stumbling over "collect emit [ ... ]" would have to know that
'collect is a function taking two arguments and that the first
argument is treated specially (a "lit-argument"). A reader not aware
of the details of 'collect could also assume that the second line
calls the function 'emit with a block! and calls the function 'collect
with the value returned from the 'emit call.


[1] I hope that really is the same as what I have in my mind as
"get-arguments" (:arg) and "lit-arguments" ('arg) :)

-- 
Best regards,
 Andreas


-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to