Re: Convert scheme to lisp
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Sat, 04 Aug 2007 14:34:49 +0200
Ralf Mattes wrote:
On Fri, 03 Aug 2007 18:30:05 +0200, Pascal Costanza wrote:
Andy Chambers wrote:Hmm - either this was typed too fast or i miss something ... shouldn'tHi,(declaim (inline node-self))
I'm trying to translate a small scheme library to common lisp and came
across something I'm not sure how to translate.
Given the definition,
(define (filter pred?)
.....)
the scheme library defines what looks like an alias
(define node-self filter)
I tried
(setf (symbol-function 'node-self)
(function filter))
and I think it does what I want but I get compile warnings that node-
self isn't defined. Is there another way of doing this that avoids
the warnings?
(defun node-self (pred?)
(filter pred?))
that be:
(declaim (inline filer))
(defun node-self (pred?)
(filter pred?))
The assumption in my posting was that filter is part of some third-party library. IMHO, you shouldn't declaim things about other people's code, because you never know what they want to do with such code internally. If filter is your own function, then declaiming it inline is fine - but then I don't get why you need two functions that do the same.
Anyway, maybe I am a bit too careful here, so your suggestion is probably also fine.
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.
- Follow-Ups:
- Re: Convert scheme to lisp
- From: Ralf Mattes
- Re: Convert scheme to lisp
- References:
- Convert scheme to lisp
- From: Andy Chambers
- Re: Convert scheme to lisp
- From: Pascal Costanza
- Re: Convert scheme to lisp
- From: Ralf Mattes
- Convert scheme to lisp
- Prev by Date: How do I make a program in Common Lisp?
- Next by Date: Re: My First Lisp...(update)
- Previous by thread: Re: Convert scheme to lisp
- Next by thread: Re: Convert scheme to lisp
- Index(es):
Relevant Pages
|