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?
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/
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/
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
>> 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/
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 ***
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.
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.
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