Re: (apply #'and '(t t nil)) not work



"Alex Mizrahi" <udodenko@xxxxxxxxxxxxxxxxxxxxx> writes:

of course you can define your own function -- to get rid of #'indetity
parameter, or allowing it to agruments directly. i.e.

(defun my-and (&rest args) (every #'identity args))

CL-USER> (my-and t t nil)
NIL
CL-USER> (apply #'my-and '(t t nil))
NIL

this looks just like AND, but it does not short-circuit evaluation.
Thanks all responses. But I do need short-circuit evalution.
I wrote a macro(very silly):
(defmacro andl (lst)
`(and ,@lst))
if type (andl '(1)) in the REPL, I get the error:
EVAL: variable QUOTE has no value
.



Relevant Pages

  • Re: Noob question I think
    ... so I get and error that says nil is not of type NO. ... CL-USER> pai linha coluna id-nr) ... CL-USER> (defun insereMP (abertos no) ...
    (comp.lang.lisp)
  • Re: #0= ... #0#
    ... (do ((line (read-line stream nil nil) ... CL-USER> &body code) ... CL-USER> (write (macroexpand-1 form) ... The macro has built a confluent data structure. ...
    (comp.lang.lisp)
  • Re: Macro woes
    ... CL-USER> (macroexpand '(test #'+)) ... CL-USER> `,(functionp x)) ... always expands into NIL. ...
    (comp.lang.lisp)
  • setf and push behave differently with symbol macro
    ... CL-USER> (defglobal glob) ... NIL ... (FOO) ...
    (comp.lang.lisp)
  • Re: (apply #and (t t nil)) not work
    ... fishmacs writes: ... CL-USER> (my-and t t nil) ... (defmacro andl (lst) ...
    (comp.lang.lisp)