On Tue, 28 Oct 2008, John Cowan wrote:

> Isaac Morland scripsit:

>> What would be the Q S-expression equivalent to (+ 1 (+ 2 (+ 3 4)))?
>> That is, the Scheme expression one would have to use instead of your
>> example if Scheme + was strictly binary?
>
> It would be the same, namely (q:call + 1 (q:call + 2 (q:call + 3 4)).
> In native Q syntax, "1+2+3+4" is syntactic sugar (albeit very useful
> sugar) for "(+) 1 ((+) 2 ((+) 3 4))", where (+) is the non-infix and
> strictly binary version of +, as in Haskell; the other parens
> are for grouping, as in infix languages generally.

Thanks for the information.  I don't see how your Q interface has anything 
to do with the issue at hand (although I am interested to read about as a 
topic in its own right).  Even if the Q S-expression for (+ 1 (+ 2 (+ 3 
4))) was nicer than the one for (+ 1 2 3 4) you could just translate the 
latter into the former.  But since it's the same, I'm having difficulty 
understanding why you would even bring up the issue.

That is, I was thinking to respond essentially that sometimes some 
language features, even if very good, translate into something ugly when 
compiled into another language, and the people writing the compiler just 
have to live with it (and similar concerns when trying to interface two 
languages togethe); but instead, I simply don't see that your Q interface 
says anything at all about the issue of how many arguments should be 
allowed to Scheme procedures.

>> But when numbers are used for their most basic purpose -- counting --
>> they must start with 0.
>
> That is, provided you are interested in counting the null set.  Basic 
> counting starts with 1.

Ok, this is starting to get a *little* off topic, but....

I'll bet \omega dollars you can't find anybody who wants to count who 
doesn't want counting the empty set to work properly.

For a more realistic challenge, find me some non-WTF code, in any 
language, that counts the elements of something by looping through all the 
elements that doesn't start with the equivalent of initializing an 
accumulator to 0.  I won't promise \omega dollars for this, but if several 
such examples were to show up, I would have to re-open my thinking on this 
point.

Isaac Morland                   CSCF Web Guru
DC 2554C, x36650                WWW Software Specialist

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to