Prev: Anybody mind to translate this Felleisen quote from German to English
Next: Macros and anonymous functions
From: Ron Garret on 2 Mar 2010 12:43 In article <7v4v5qFjblU1(a)mid.individual.net>, Tamas K Papp <tkpapp(a)gmail.com> wrote: > On Tue, 02 Mar 2010 16:01:37 +0000, Tim Bradshaw wrote: > > > In another newsgroup, someone is complaining fiercely that > > "SPOTTED-DOG-P" does not subtract "P" and "DOG" from "SPOTTED". > > A somewhat tangential question: lately I am gravitating towards > SPOTTED-DOG? instead of SPOTTED-DOG-P. Is that "bad style" in CL? Looks > so much nicer, and appears more intuitive to me. <ironic> It's considered bad style because that's how they do it in Scheme, and anything that they do in Scheme must be bad. </ironic> Seriously though, the problem is not so much with the question mark per se as the inconsistency. Yes, the -P convention is weird, but at least it's (mostly) consistent. If you start throwing question marks into the mix then anyone who uses your code has to remember that *these* predicates use question marks but *those* still use -P. Whether enjoying the improved aesthetics of question marks is worth the extra cognitive burden they impose in the context of CL's established conventions depends on your quality metric. rg
From: Tamas K Papp on 2 Mar 2010 12:48 On Tue, 02 Mar 2010 09:43:00 -0800, Ron Garret wrote: > In article <7v4v5qFjblU1(a)mid.individual.net>, > Tamas K Papp <tkpapp(a)gmail.com> wrote: > >> On Tue, 02 Mar 2010 16:01:37 +0000, Tim Bradshaw wrote: >> >> > In another newsgroup, someone is complaining fiercely that >> > "SPOTTED-DOG-P" does not subtract "P" and "DOG" from "SPOTTED". >> >> A somewhat tangential question: lately I am gravitating towards >> SPOTTED-DOG? instead of SPOTTED-DOG-P. Is that "bad style" in CL? >> Looks so much nicer, and appears more intuitive to me. > > <ironic> > It's considered bad style because that's how they do it in Scheme, and > anything that they do in Scheme must be bad. </ironic> > > Seriously though, the problem is not so much with the question mark per > se as the inconsistency. Yes, the -P convention is weird, but at least > it's (mostly) consistent. If you start throwing question marks into the > mix then anyone who uses your code has to remember that *these* > predicates use question marks but *those* still use -P. Whether Most environments have some kind of autocompletion/keyword lookup. Eg if this is a keyword, I can just use SLIME to complete it to the right form. So I don't really see the issue here. Fortunately I find that with SLIME, I have to _remember_ very few things like this, so I can use my small brain capacity for other, more important issues. Tamas
From: Ron Garret on 2 Mar 2010 12:59 In article <7v51bvFisU1(a)mid.individual.net>, Tamas K Papp <tkpapp(a)gmail.com> wrote: > On Tue, 02 Mar 2010 09:43:00 -0800, Ron Garret wrote: > > > In article <7v4v5qFjblU1(a)mid.individual.net>, > > Tamas K Papp <tkpapp(a)gmail.com> wrote: > > > >> On Tue, 02 Mar 2010 16:01:37 +0000, Tim Bradshaw wrote: > >> > >> > In another newsgroup, someone is complaining fiercely that > >> > "SPOTTED-DOG-P" does not subtract "P" and "DOG" from "SPOTTED". > >> > >> A somewhat tangential question: lately I am gravitating towards > >> SPOTTED-DOG? instead of SPOTTED-DOG-P. Is that "bad style" in CL? > >> Looks so much nicer, and appears more intuitive to me. > > > > <ironic> > > It's considered bad style because that's how they do it in Scheme, and > > anything that they do in Scheme must be bad. </ironic> > > > > Seriously though, the problem is not so much with the question mark per > > se as the inconsistency. Yes, the -P convention is weird, but at least > > it's (mostly) consistent. If you start throwing question marks into the > > mix then anyone who uses your code has to remember that *these* > > predicates use question marks but *those* still use -P. Whether > > Most environments have some kind of autocompletion/keyword lookup. Eg > if this is a keyword, I can just use SLIME to complete it to the right > form. So I don't really see the issue here. That depends on what else is in your environment. A predicate like SPOTTED-DOG[-P|?] is likely to have been defined in conjunction with, say, a class or type named SPOTTED-DOG, which case autocompletion may or may not help depending on what it does when there is more than one completion. But that is a good point. I don't use autocompletion myself because the CCL IDE doesn't have it so I tend to forget about it. rg
From: Norbert_Paul on 2 Mar 2010 13:19 (axiom-user? you) In axiom foo? is for predicates, bar! for destructive operations (like rplaca!) and baz for functions. However, there are inconsistencies, too: An assigment is x := 7 and not x :=! 7 .. Norbert Tamas K Papp wrote: > On Tue, 02 Mar 2010 16:01:37 +0000, Tim Bradshaw wrote: > >> In another newsgroup, someone is complaining fiercely that >> "SPOTTED-DOG-P" does not subtract "P" and "DOG" from "SPOTTED". > > A somewhat tangential question: lately I am gravitating towards > SPOTTED-DOG? instead of SPOTTED-DOG-P. Is that "bad style" in CL? Looks > so much nicer, and appears more intuitive to me. > > Tamas
From: Tim Bradshaw on 2 Mar 2010 13:42
On 2010-03-02 16:52:14 +0000, Ron Garret said: >> this). > > I have already conceded that Common Lisp sucks. But even Common Lisp is > less sucky than other languages in this regard because it is always > possible to use READ-FROM-STRING, GET-MACRO-CHARACTER, and MACROEXPAND > to get an explanation of what is going on in terms of something that you > can type into a search engine or do a meta-point on. (Except format > strings of course. Format strings are irredeemably sucky.) So, well, I type the letter q into the perldoc search plugin for Firefox (or equivalently into the perldoc search box, and I get this page: http://perldoc.perl.org/functions/q.html, as the only hit. How hard can it be? >> > > You have completely missed the point. Obviously once you *know* Perl > all these issues evaporate. The issue is what happens when you > encounter a new construct that you don't already know. .... and you can't drive the documentation. Yeah, I guess that can be a problem. I'm done with this now |