fn abstraction?
- From: Nate <beta.entity.k@xxxxxxxxx>
- Date: 30 May 2007 20:18:46 -0700
so I've been wondering, am I missing something hideously wrong with
this? As in, is there something ugly, etc? because it's clear when you
use it for one use or the other, and I'm wondering why it's not been
done before (probably readability?).
(defmacro fn (&body bd)
(if (consp (first bd))
`(function (lambda ,(first bd) ,@(cdr bd)))
`(defun ,(first bd) ,(second bd) ,@(cddr bd))))
as in
(mapcar #'(lambda (x y) (list x y)) lst1 lst2) =>
(mapcar (fn (x y) (list x y)) lst1 lst2)
nate
ps I might have stolen the idea from arc
.
- Follow-Ups:
- Re: fn abstraction?
- From: Kaz Kylheku
- Re: fn abstraction?
- Prev by Date: Re: code critique
- Next by Date: Re: code critique
- Previous by thread: Continuation based app servers
- Next by thread: Re: fn abstraction?
- Index(es):
Relevant Pages
|