Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!hsdndev!husc6!carlton From: carlton@husc10.harvard.edu (david carlton) Newsgroups: comp.lang.scheme Subject: Re: Return value of SET!/SETQ/=, and order of evaluation Message-ID: Date: 1 Apr 91 23:25:43 GMT Article-I.D.: husc10.CARLTON.91Apr1182543 References: <9104011524.AA09177@schizo> Sender: news@husc6.harvard.edu Organization: Citizens for Boysenberry Jam Lines: 86 In-reply-to: gjc@mitech.COM's message of 29 Mar 91 17:23:49 GMT In article <9104011524.AA09177@schizo> gjc@mitech.COM writes: Actually, throw in the fact that in Scheme the empty list and logical false are DIFFERENT. As a LISP programmer for over 10 years I find it much more comfortable to program in C than in the latest Scheme standards. HEY GUYS: I think you have really blown it, BIG TIME. In C, I use the return value of assignments all the time. It is a very common programming practice. Also, I use the fact that the NULL pointer is logical false. And also, I use the order of evaluation implied by "&&" and "||" quite a bit. In reverse order of your complaints: \proto{and}{ \hyperi{test} \dotsfoo}{essential \exprtype}} The \hyper{test} expressions are evaluated from left to right, and the value of the first expression that evaluates to a false value (see section~\ref{booleansection}) is returned. Or similarly enforces an order of evaluation. Happy? Yes, I use return values of assignments all the time when programming in C, too. I use assignments all the time when programming in C, for that matter. I very rarely use them in Scheme, aside from the special case of defining a global variable once. If I remember properly, in Guy L. Steele Jr.'s masters thesis, he actually expressed regret that Scheme provides as general an assignment statement as it does, since the only things that it is particularly necessary for are assignments to global variables and for creating objects with state. I wouldn't go quite that far (and am curious whether or not he still agrees with that sentiment, or for that matter whether or not I am correctly summarizing what he originally said), but the fact remains that it is not necessary to use assignments nearly as often in Scheme as it is in C. For example, you don't need to use assignments when writing loops, whereas you do in C unless you write your loops with function calls, making them (for all C compilers that I am aware of) prohibitively expensive, to put it mildly. I would be curious to see an example of Scheme code where you find it necessary to use the value of an assignment. I don't really want to get into a ()/#f argument. I do have one question, though: if you think that values other than #f should be false, why stop with ()? Why shouldn't #(), "", and 0 be false? Or, if you want to have (eq? #f '()), why not have those other things also all be the same object? The way that Scheme is defined now, WELL, it just forces the programs to be much more verbose, with lots of extra LAMBDA/LET statements, and local variables, and even extra assignments. Again, could you post some examples? What you are saying does not agree with my experiences. There are some things in Scheme which are clearly "STATEMENTS" that is, forms which make no sense to use in a "EXPRESSION" (value) context. There there are things which are expressions. I'm not sure I understand what you are saying - do you mean that (1 2 3) is a STATEMENT while (+ 1 2) is an EXPRESSION? OK. Is a procedure call important? If so, then why is it not possible to define a procedure which has no defined return value? Or, for that matter, why not define a procedure which returns more than one value? I for one think that that would be a wonderful idea, and it looks like it will show up in R5RS. Look in the latest issue of Lisp Pointers if you want to see the proposal for this. That is, why is it not possible to extend the language (via procedure definitions) in the class of STATEMENTS (e.g. built in SET!-CAR vs my own defined SET!-FROB)? Why only in the class of EXPRESSIONS? Again, I do not understand. Other standards questions: are their versions of any pre-R3RS standards available online? Aren't 'r' and 'l' semivowels, as well as 'y' and 'w'? (They certainly are in Sanskrit, but I don't know what English linguists say about such things.) What is the latest info on ordering the IEEE standard? Is it still possible to get a copy of the final draft for $27? david carlton carlton@husc9.harvard.edu