From: Christophe Rhodes on 8 Jan 2010 11:30 Kyle M <kylemcg(a)gmail.com> writes: > There isn't anything wrong with what Ron said about sequences. In > practice, there are no sequences that are not lists or vectors. Others have pointed you at the chapter and verse. This followup is to say that your practice is not my practice: I use sequences that are not lists or vectors in Common Lisp both at work and at play. Christophe
From: Pillsy on 8 Jan 2010 12:41 On Jan 8, 2:03 am, Ron Garret <rNOSPA...(a)flownet.com> wrote: > In article > <3eb878f3-019b-4602-b5e7-b5aef4fdf...(a)t12g2000vbk.googlegroups.com>, > Pillsy <pillsb...(a)gmail.com> wrote: > > On Jan 7, 8:28 pm, Ron Garret <rNOSPA...(a)flownet.com> wrote: [...] > > > This is not really Peter's fault, by the way. Lisp pedagogy is hobbled > > > by the fact that Common Lisp has built-in support for particular > > > implementations of associative maps, but not for abstract associative > > > maps. This, BTW, is consistent with another point of view that has a > > > significant constituency within the Lisp community, to wit, that CL is a > > > language for experts and the fact that it does not cater to beginners is > > > a feature, not a bug. > > I'm really not seeing the connection between the two points you're > > making here. > It's not a strong connection. I'm just pointing out how the low-level > view of DEFSTRUCT is consistent with a certain aspect of the Lisp > culture. Maybe. Then agin, there's DEFCLASS, which allows a lot of similar things, but is more flexible, allows more reflection, is generally higher-level and often slower. That's a pretty good motivation for taking a lower- level view of DEFSTRUCT in and of itself. Also, with the :TYPE argument, you can actually use DEFSTRUCT as a way of easily putting something a little more abstract and high-level on top of an existing low-level, positionally-based list-as-data-structure implementation. I think it's pretty natural to view structure objects as an intermediate step between the low-level arrays and conses and the higher level standard objects. Cheers, Pillsu
From: Ron Garret on 8 Jan 2010 13:30 In article <87y6k87q3e.fsf(a)ma-patru.mathematik.uni-karlsruhe.de>, Nicolas Neuss <lastname(a)math.uni-karlsruhe.de> wrote: > Ron Garret <rNOSPAMon(a)flownet.com> writes: > > > This is not really Peter's fault, by the way. Lisp pedagogy is > > hobbled by the fact that Common Lisp has built-in support for > > particular implementations of associative maps, but not for abstract > > associative maps. This, BTW, is consistent with another point of view > > that has a significant constituency within the Lisp community, to wit, > > that CL is a language for experts and the fact that it does not cater > > to beginners is a feature, not a bug. > > I would be interested in who is claiming such a thing. Quite the > opposite, I think that most of us think > > 1. CL is a language for everyone with good taste. > > 2. It does cater to beginners at least as much as the very popular > languages C or Java, and surely much more than C++. (Also the > difference in accessibility to Scheme or Python is not large, IMO.) > > 3. Where it does not, there are either important reasons, or you can > easily adapt it to your needs. > > Nicolas Erik Naggum was the leading (or at least the most visible) proponent of this point of view. I believe Kenny Tilton subscribes to it. And I would say that even your comment that "CL is a language for everyone with good taste" is a minor variation on this theme, which is "Lisp is a language for people with characteristic X" where X is a characteristic that is both desirable and subjective. Whether X is "an expert" or "with good taste" or "cool" or whatever, it allows one to apply the no-true-scotsman fallacy to any criticism of the language: all negative views can be dismissed because the critic is obviously not an expert/has bad taste/not cool, etc. BTW, I am not saying this point of view is *correct*, only that it is a point of view that has a vocal constituency. rg
From: Ron Garret on 8 Jan 2010 13:45 In article <87skag3jnt.fsf(a)cantab.net>, Christophe Rhodes <csr21(a)cantab.net> wrote: > Ron Garret <rNOSPAMon(a)flownet.com> writes: > > > In article <87wrzt3akf.fsf(a)cantab.net>, > > Christophe Rhodes <csr21(a)cantab.net> wrote: > > > >> Ron Garret <rNOSPAMon(a)flownet.com> writes: > >> > >> > On the other hand, Lisp has a strong cultural bias against creating > >> > *new* abstractions, preferring instead to pun mainly on cons cells. > >> > >> This is not representative of the Lisp culture that I think of myself as > >> a part of. > > > > I'm not saying everyone subscribes to this, but many (I would go so far > > as to say an overwhelming majority) do. > > Many who are within the "Lisp culture"? Or an overwhelming majority of > those whose only experience with Lisp is a one-term course in a CS > degree? I don't know. I haven't done a controlled study. > For what it's worth, the collection of anecdotes that make up > my personal experience is diametrically opposed to the view that you > hold: no Lisper that I know, whose code I work with, whose stories I > hear, prefers mainly to pun on cons cells rather than creating new > abstractions. I would be very pleased if it turned out I was wrong about this. > > Lisp pedagogy certainly leans heavily in this direction. Is there > > even one Lisp book out there that doesn't introduce ALists and/or > > PLists early on and saves CLOS as an "advanced topic"? > > Keene, S. (1989) Object-Oriented Programming in Common Lisp > Kizcales, G. et al. (1991) The Art of the Metaobject Protocol > Levine, N. (forthcoming) Lisp Outside the Box I'm looking forward to Nick's book. > >> SEQUENCE is not just the union of lists and vectors. > > > > Really? How do you make a sequence that isn't either a list or a vector? > > By calling an appropriate constructor, either user-defined or provided > by your implementation. For one approach, see the work I presented at > ILC'07: "User-extensible sequences in Common Lisp". But the point is > that the CL standard explicitly says that LIST and VECTOR do not > necessarily form an exhaustive partition of SEQUENCE. That rather begs the question doesn't it? I know the standard says that there can be non-list non-vector sequences, but I don't know of any implementation that actually provides a non-list non-vector sequence type, and I don't of know any way to create a non-list non-vector sequence type without hacking the implementation. It is, of course, possible to create a sequence CLASS whose behavior mirrors and extends the sequence TYPE provided by CL, but that is not the same thing as being able to create an object that answers true to (typep x (and cl:sequence (not (or cl:list cl:vector)))) rg
From: Ron Garret on 8 Jan 2010 14:05
In article <7qp2c5Fej0U1(a)mid.individual.net>, Pascal Costanza <pc(a)p-cos.net> wrote: > On 08/01/2010 09:46, Ron Garret wrote: > > Even the practical camp has a somewhat schizophrenic attitude towards > > macros. On the one hand, macros are often touted as the cool feature > > that makes Lisp superior to other languages. On the other hand, > > reactions to specific macros are often strongly negative. "Leave macro > > writing to the experts" is an often-heard refrain, and even macros > > written by experts are more often than not very badly received (e.g. > > John Foderaro's IF* macro, or more recently, Pascal Costanza's filtered > > functions). The LOOP macro has a dedicated band of detractors who > > regularly urge people not to use it because it isn't "Lispy" enough > > (whatever that could possibly mean). The *idea* of macros seems to be > > much more enthusiastically embraced than actual macros. > > I don't think that's correct. In the case of filtered functions, the > reactions were mostly positive (to my surprise, I didn't expect that > much positive feedback). Only one person was especially aggressive in > voicing his negative opinion about them. If I understand correctly, that > was the same with IF*. You can easily get wrong impressions when > listening only to the loudest voices. Could be. > LOOP has a lot of detractors, but also a lot of fans. If that is in any > way representative, at the first European Lisp Workshop (in Oslo in > 2004), there were 40 participants, and the overwhelming majority stated > to use LOOP for iterative tasks (to everybody's surprise). I heard a story once about how it was common knowledge that everyone in California was crazy. But if you actually go to California they will tell you that no, it's not all of California that's crazy, it's the folks in *southern* California that are crazy. And if you go to southern California they will tell you, no, it's not all of southern California, it's just LA. And if you go to LA they will tell you it's not LA, it's Hollywood. And if you go to Hollywood they'll tell you it's not all of Hollywood, it's just this one neighborhood. And if you go to that neighborhood they'll tell you it's not the whole neighborhood, it's just this one crazy guy at the end of the block. I had always thought this story was a joke, but maybe that's exactly what is happening here. rg |