From: jmckitrick
Subject: Other common macro idioms
Date: 
Message-ID: <1180964073.711006.14390@w5g2000hsg.googlegroups.com>
The first two are obvious and common: WITH-FOO and DEF-FOO.  What are
some other common idioms for abstractions where it is often
advantageous to express them using macros?

From: Dan Bensen
Subject: Re: Other common macro idioms
Date: 
Message-ID: <f41jl0$2ve$1@wildfire.prairienet.org>
jmckitrick wrote:
> The first two are obvious and common: WITH-FOO and DEF-FOO.  What are
> some other common idioms for abstractions where it is often
> advantageous to express them using macros?

FOO* indicates sequential evaluation instead of parallel.
It's normally applied to binding forms, but when I made an
Elisp-style IF macro that puts a progn in the else form,
I called it IF*.

-- 
Dan
www.prairienet.org/~dsb/
From: John Thingstad
Subject: Re: Other common macro idioms
Date: 
Message-ID: <op.tteuweg4pqzri1@pandora.upc.no>
On Mon, 04 Jun 2007 20:00:37 +0200, Dan Bensen <··········@cyberspace.net>  
wrote:

> jmckitrick wrote:
>> The first two are obvious and common: WITH-FOO and DEF-FOO.  What are
>> some other common idioms for abstractions where it is often
>> advantageous to express them using macros?
>
> FOO* indicates sequential evaluation instead of parallel.
> It's normally applied to binding forms, but when I made an
> Elisp-style IF macro that puts a progn in the else form,
> I called it IF*.
>

Are you aware that ACL already has a IF* macro? They have it available  
(somewhere) on their website.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
From: Larry Clapp
Subject: Re: Other common macro idioms
Date: 
Message-ID: <slrnf68pl1.cns.larry@theclapp.ddts.net>
On 2007-06-04, John Thingstad <··············@chello.no> wrote:
> On Mon, 04 Jun 2007 20:00:37 +0200, Dan Bensen <··········@cyberspace.net>  
> wrote:
>
>> jmckitrick wrote:
>>> The first two are obvious and common: WITH-FOO and DEF-FOO.  What
>>> are some other common idioms for abstractions where it is often
>>> advantageous to express them using macros?
>>
>> FOO* indicates sequential evaluation instead of parallel.  It's
>> normally applied to binding forms, but when I made an Elisp-style
>> IF macro that puts a progn in the else form, I called it IF*.
>
> Are you aware that ACL already has a IF* macro? They have it available  
> (somewhere) on their website.

http://www.franz.com/~jkf/ifstar.txt
From: Dan Bensen
Subject: Re: Other common macro idioms
Date: 
Message-ID: <f421ti$7ed$1@wildfire.prairienet.org>
 >> Dan Bensen <··········@cyberspace.net> wrote:
>>> FOO* indicates sequential evaluation instead of parallel.  It's
>>> normally applied to binding forms, but when I made an Elisp-style
>>> IF macro that puts a progn in the else form, I called it IF*.

 > On 2007-06-04, John Thingstad <··············@chello.no> wrote:
>> Are you aware that ACL already has a IF* macro? They have it available  
>> (somewhere) on their website.

Larry Clapp wrote:
> http://www.franz.com/~jkf/ifstar.txt

Looks like another LOOPish abomination.  :) :)

-- 
Dan
www.prairienet.org/~dsb/
From: Barry Margolin
Subject: Re: Other common macro idioms
Date: 
Message-ID: <barmar-7AA6E6.20511904062007@comcast.dca.giganews.com>
In article <·······················@w5g2000hsg.googlegroups.com>,
 jmckitrick <···········@yahoo.com> wrote:

> The first two are obvious and common: WITH-FOO and DEF-FOO.  What are
> some other common idioms for abstractions where it is often
> advantageous to express them using macros?

FOOLET, as in FLET, MACROLET, SYMBOL-MACROLET, etc.  All the built-in 
ones are actually special forms, but I suppose there's a possibility of 
user-defined operators in a similar style.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Vassil Nikolov
Subject: Re: Other common macro [naming] idioms
Date: 
Message-ID: <ka3b17tbgf.fsf@localhost.localdomain>
On Mon, 04 Jun 2007 06:34:33 -0700, jmckitrick <···········@yahoo.com> said:

| The first two are obvious and common: WITH-FOO and DEF-FOO.  What are
| some other common idioms for abstractions where it is often
| advantageous to express them using macros?

  Just looking at standard Common Lisp names:

     * DOFOO and DO-FOO for iteration;
     * FOO-BIND for, well, binding;
     * FOOCASE and FOO-CASE for dispatch;
     (opening CLtL's index of macro names)
     * FOOF for place manipulation

  (by the way, I believe it would be either DEFFOO or DEFINE-FOO, but
  not DEF-FOO).

  ---Vassil.


-- 
The truly good code is the obviously correct code.
From: Ari Johnson
Subject: Re: Other common macro [naming] idioms
Date: 
Message-ID: <m2vee3jdrr.fsf@hermes.theari.com>
Vassil Nikolov <···············@pobox.com> writes:

> On Mon, 04 Jun 2007 06:34:33 -0700, jmckitrick <···········@yahoo.com> said:
>
> | The first two are obvious and common: WITH-FOO and DEF-FOO.  What are
> | some other common idioms for abstractions where it is often
> | advantageous to express them using macros?
>
>   Just looking at standard Common Lisp names:
>
>      * DOFOO and DO-FOO for iteration;
>      * FOO-BIND for, well, binding;
>      * FOOCASE and FOO-CASE for dispatch;
>      (opening CLtL's index of macro names)
>      * FOOF for place manipulation
>
>   (by the way, I believe it would be either DEFFOO or DEFINE-FOO, but
>   not DEF-FOO).

Probably DEFOO, DEFBAR, and DEFINE-FOO-BAR.
From: Rainer Joswig
Subject: Re: Other common macro idioms
Date: 
Message-ID: <joswig-B16ACB.12392205062007@news-europe.giganews.com>
In article <·······················@w5g2000hsg.googlegroups.com>,
 jmckitrick <···········@yahoo.com> wrote:

> The first two are obvious and common: WITH-FOO and DEF-FOO.  What are
> some other common idioms for abstractions where it is often
> advantageous to express them using macros?

There is also

* WITHOUT-FOO
* USING-FOO
* BIND-FOO

-- 
http://lispm.dyndns.org