Subject: Re: why we have cons? From: Erik Naggum <clerik@naggum.no> Date: 1998/01/07 Newsgroups: comp.lang.lisp Message-ID: <3093165104656878@naggum.no> * "Xah" <xah@best.com> | Let me make it clear one last time that all I'm concerned is interface. : | Erik expressed that he is uncertain about whether I care about | implemenation, becaues he has explained that `cons' needs not to be used, | and if I agree to this, I shouldn't have any problems. The reason for his | uncertainty is: "I have not yet expressed whether I agree that cons, car, | cdr, needs not to be used if one does not want to.". I'm glad that my first impression was so much better than my revised opinion -- this is not a stupid concern, and I can also sympathize with it, since I also think Scheme is at fault for not providing a standard view of lists that hides the implementation. (I've already said this, but just to be sure you don't ignore it, again.) however, such _is_ Scheme, and I guess the design rationale is "if you can do it yourself, regardless of cost, we shouldn't do it for you". when you bring up SICP and its use of the implementation-oriented functions instead of making an "abstraction barrier" by using a few simple definitions, I'm somewhat disappointed that your criticism is accurate. | On the whole, I do not doubt Erik's words, but because my limited | knowledge of Scheme, I'm yet unable to confirm whether I could write code | without ever using cons, car, cdr and still have a normal looking Scheme | code. this is also a valid concern. when everybody has to invent their own simple definitions of a list abstraction, they will naturally do it subtly differently, and then we're left with designing a new language on top of Scheme in every project or library or what have you. (this is one of the reasons I don't like Scheme.) | Now since this classic Scheme book is filled with cons and its associated | primitives (car, cdr, pair?, null?), one could imagine writing codes | without using them is probably out-of-style with the community. I don't know whether you would. | Also, as Erik himself expressed, only good or experiences lisper avoids | using cons and associated primitives. well, not _only_ good ones, but good Lisp programmers communicate their intent to other programmers (and themselves) as much as they communicate with the compiler and Lisp system. (I think this is true of any good programmer, regardless of language, and that bad programmers prefer "idiom" and arcana to clarity of purpose, but that's immaterial now.) | Basically, I think if you have something in a language, people will use | it. Isn't this true by experience? yes, this is unfortunately true. however, there is this notion of a good user of a language, and I don't think we should optimize away the good user by forbidding the bad ones. there _is_ a place for the kind of code grinders who make things "work most of the time". we just need to make sure they stay in New Jersey. (sorry.) | PS for few non-technical reasons, I'm looking for a second language other | than Mma. That is the reason I'm learning Scheme. I think Common Lisp would be a good choice for you. Scheme is like coming to a construction site and being thrown a hammer and a box of nails and off you go to make something or other with whatever raw materials you find. Common Lisp is like moving into a big house that is inhabitable right away but which sort of humbles you for the first month or so while you're trying to figure out what and where everything is, then becomes so comfortable you don't want to leave it. where Scheme is for people who are really arrogant and want only the most basic building blocks because they think they can craft everything they need better than anybody else, Common Lisp is for people who are able and willing to accept that others are a lot better at a lot of hard stuff that it would only be nice if they could learn someday when the hard stuff that they are themselves good at has been solved to satisfaction. I see Common Lisp as a language for interchange between experts (and those who want to become experts) and Scheme as a language for students. I fear, as you also seem to do, that Scheme will force you to stay on the lower levels if you want to talk to anybody else about your code. in conclusion, I don't think you're the Scheme type. Scheme types tend to _want_ to play with the implementation in order to build abstractions from first principles. of course, people do lots of neat stuff in Scheme, too, but it isn't "bare Scheme", anymore. with lots and lots of code that gives them the abstraction level they really want, frequently so much that the code only maintains a superficial Scheme flavor, it's an open question whether it was indeed written in Scheme. my background is in C and Unix and I have to come to dislike the need to build everything from scratch every time, and so I embrace the "gifts" in Common Lisp, but I still find that I need to know the internals in order to _successfully_ ignore them. somebody said: "know yourself. forget yourself". I think the order is as important in that saying as it is with internals in a programming language implementation. #:Erik -- The year "98" was new 1900 years ago. | Help fight MULE in GNU Emacs 20! Be year 2000 compliant, write "1998"! | http://sourcery.naggum.no/emacs/