Re: (apply #'and '(t t nil)) not work
- From: "Alex Mizrahi" <udodenko@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 31 Mar 2008 18:15:46 +0300
??>> this looks just like AND, but it does not short-circuit evaluation.
f> Thanks all responses. But I do need short-circuit evalution.
short-circuiting only makes sense when you do evaluation.
if you have a list,it's contents are already evaluated, hence
short-circuiting doesn't make sense.
if you post some bigger sample of what you want to achieve perhaps we can
point what is best way of implementing this.
f> I wrote a macro(very silly):
f> (defmacro andl (lst)
f> `(and ,@lst))
f> if type (andl '(1)) in the REPL, I get the error:
f> EVAL: variable QUOTE has no value
sure it does not. because it is a macro, and it's contents are not
evaluated.
i advice not to use macros or EVAL unless you _absolutely_ want to. keep in
mind you can do 99.99% of stuff w/o macros and eval -- macros just make some
code more elegant, eval can help with extreme dynamism.
you absolutely do not need to write macros or use something advanced when
you're just writing regular code.
.
- References:
- (apply #'and '(t t nil)) not work
- From: fishmacs
- Re: (apply #'and '(t t nil)) not work
- From: Alex Mizrahi
- Re: (apply #'and '(t t nil)) not work
- From: fishmacs
- (apply #'and '(t t nil)) not work
- Prev by Date: Re: (apply #'and '(t t nil)) not work
- Next by Date: Re: indent for CL
- Previous by thread: Re: (apply #'and '(t t nil)) not work
- Next by thread: Re: (apply #'and '(t t nil)) not work
- Index(es):
Relevant Pages
|