From: Frederic Brunel
Subject: Why define-condition?
Date: 
Message-ID: <laisha4dce.fsf@in-fusio.com>
I'm wondering why the Common Lisp standard defines "define-condition"
and not "defcondition"? 

Is there's a convention for using "define-*" rather than "def*"
for function names?

-- 
Frederic Brunel

From: ·········@random-state.net
Subject: Re: Why define-condition?
Date: 
Message-ID: <c2s57r$4ldrr$1@midnight.cs.hut.fi>
Frederic Brunel <···············@in-fusio.com> wrote:

> Is there's a convention for using "define-*" rather than "def*"
> for function names?

My impression is that:

 a) If the name is truncated use def.

 b) If the name contains slashes use define.

This leaves untrancated names without slahes - like condition - without a
clear guideline, and then it's presumably down to aesthetics.

A stronger version would be to say "use define if and only if the name
contains slashes", which is nice in the sense that it always tells you
what to do, and doesn't go wrong -- but it also won't produce results
identical with CL itself, since you'd end up with defcondition.

However if there is true consensus to be found, my suspicion is that it
centers around:

 "What ever you do, don't ever do def-*." 

Then again, there are plenty of packages that violate this out there, some
of them quite prominent. ;-)

Cheers,

  -- Nikodemus
From: Pascal Costanza
Subject: Re: Why define-condition?
Date: 
Message-ID: <c2s5hr$108c$1@f1node01.rhrz.uni-bonn.de>
Frederic Brunel wrote:
> I'm wondering why the Common Lisp standard defines "define-condition"
> and not "defcondition"? 
> 
> Is there's a convention for using "define-*" rather than "def*"
> for function names?

My guess is:

- If you are writing code during the 60's and 70's, use "def*".
- If you are writing code during the 80's and 90's, use "define-*", 
unless you're sentimental.


Pascal

-- 
Pascal Costanza               University of Bonn
···············@web.de        Institute of Computer Science III
http://www.pascalcostanza.de  R�merstr. 164, D-53117 Bonn (Germany)

1st European Lisp and Scheme Workshop
June 13 - Oslo, Norway - co-located with ECOOP 2004
http://www.cs.uni-bonn.de/~costanza/lisp-ecoop/
From: Artem Baguinski
Subject: Re: Why define-condition?
Date: 
Message-ID: <87r7vy9roo.fsf@caracolito.lan>
Pascal Costanza <········@web.de> writes:

> Frederic Brunel wrote:
>> I'm wondering why the Common Lisp standard defines "define-condition"
>> and not "defcondition"? Is there's a convention for using "define-*"
>> rather than "def*"
>> for function names?
>
> My guess is:
>
> - If you are writing code during the 60's and 70's, use "def*".
> - If you are writing code during the 80's and 90's, use "define-*",
>   unless you're sentimental.

When the revolution came the convention has changed to
"do-define-*-please". the caller should be prepared to
"now-why-should-i?"  condition though.

-- 
gr{oe|ee}t{en|ings}
artm 
From: Marco Antoniotti
Subject: Re: Why define-condition?
Date: 
Message-ID: <s0m4c.99$IJ5.76932@typhoon.nyu.edu>
Artem Baguinski wrote:
> Pascal Costanza <········@web.de> writes:
> 
> 
>>Frederic Brunel wrote:
>>
>>>I'm wondering why the Common Lisp standard defines "define-condition"
>>>and not "defcondition"? Is there's a convention for using "define-*"
>>>rather than "def*"
>>>for function names?
>>
>>My guess is:
>>
>>- If you are writing code during the 60's and 70's, use "def*".
>>- If you are writing code during the 80's and 90's, use "define-*",
>>  unless you're sentimental.
> 
> 
> When the revolution came the convention has changed to
> "do-define-*-please". the caller should be prepared to
> "now-why-should-i?"  condition though.
> 


I think we should go the INTERCAL way.

(please define foo (x y) ....)

That would make us lispers kinder :)

Cheers
--
Marco
From: Pascal Bourguignon
Subject: Re: Why define-condition?
Date: 
Message-ID: <871xnxyk7t.fsf@thalassa.informatimago.com>
Marco Antoniotti <·······@cs.nyu.edu> writes:
> I think we should go the INTERCAL way.
> 
> (please define foo (x y) ....)
> 
> That would make us lispers kinder :)

I assume lovers of extended loop will love this please form too.

(please not !)
-- 
__Pascal_Bourguignon__                     http://www.informatimago.com/
There is no worse tyranny than to force a man to pay for what he doesn't
want merely because you think it would be good for him.--Robert Heinlein
http://www.theadvocates.org/
From: Frederic Brunel
Subject: Re: Why define-condition?
Date: 
Message-ID: <lawu5qum4m.fsf@in-fusio.com>
Pascal Costanza <········@web.de> writes:

> My guess is:
>
> - If you are writing code during the 60's and 70's, use "def*".
> - If you are writing code during the 80's and 90's, use "define-*",
>   unless you're sentimental.

  Well, very few people applies this rule...

-- 
Frederic Brunel
From: Barry Margolin
Subject: Re: Why define-condition?
Date: 
Message-ID: <barmar-04DCB2.11432512032004@comcast.ash.giganews.com>
In article <··············@in-fusio.com>,
 Frederic Brunel <···············@in-fusio.com> wrote:

> Pascal Costanza <········@web.de> writes:
> 
> > My guess is:
> >
> > - If you are writing code during the 60's and 70's, use "def*".
> > - If you are writing code during the 80's and 90's, use "define-*",
> >   unless you're sentimental.
> 
>   Well, very few people applies this rule...

I think it's actually more like:

If it's expected to be used frequently, use "def*".  If it's less 
commonly used, use "define-*".

Thus, we have DEFMETHOD and DEFGENERIC, but DEFINE-METHOD-COMBINATION.

Another variation is to use DEF* for a simple API, DEFINE-* for a more 
complex one, as in DEFSETF vs. DEFINE-SETF-EXPANDER.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
From: Dirk Gerrits
Subject: Re: Why define-condition?
Date: 
Message-ID: <aoH6c.52426$pN4.46817@amsnews03.chello.com>
Pascal Costanza wrote:
> Frederic Brunel wrote:
> 
>> I'm wondering why the Common Lisp standard defines "define-condition"
>> and not "defcondition"?
>> Is there's a convention for using "define-*" rather than "def*"
>> for function names?
> 
> 
> My guess is:
> 
> - If you are writing code during the 60's and 70's, use "def*".
> - If you are writing code during the 80's and 90's, use "define-*", 
> unless you're sentimental.

I thought the convention was define-* for more than one word 
(define-compiler-macro) and def* otherwise (defmacro). define-condition 
seems to be the only exception to this in the hyperspec. Why that is so, 
I have no idea.

Dirk Gerrits

PS. last sunday's Cologne Lisp meeting was great. :)
From: Kaz Kylheku
Subject: Re: Why define-condition?
Date: 
Message-ID: <cf333042.0403121313.11f26e45@posting.google.com>
Frederic Brunel <···············@in-fusio.com> wrote in message news:<··············@in-fusio.com>...
> I'm wondering why the Common Lisp standard defines "define-condition"
> and not "defcondition"? 
> 
> Is there's a convention for using "define-*" rather than "def*"
> for function names?

Probably because conditions are newer.

You see the same effect in other languages or system interfaces.

For example in POSIX you find things like

   pthread_mutex_lock

but in the ancient C library you have

   strpbrk

You could ask, why pthread_mutex_lock rather than pthrmxlk(). It's
because, like so many Wheel of Fortune players, we'd like to buy a few
vowels. Now that we can afford them.

:)