i`m a lisp newbie, just think about the idear of lisp, puzzled at the
define of base function, so please tell me how the "plus" defined in
lisp? thanks
·······@etang.com (attonie) writes:
> i`m a lisp newbie,
Welcome!
> just think about the idear of lisp, puzzled at the define of base
> function, so please tell me how the "plus" defined in lisp? thanks
Perhaps you're looking for + ?
It's already there. You just use it.
(+ 1 2)
=> 3
Or maybe you're asking how you would define PLUS given +? I guess
if you wanted just a two-argument version you'd do:
(defun plus (x y)
(+ x y))
or if you wanted a multi-argument version you'd do:
(defun plus (&rest arguments)
(apply #'+ arguments))
If you're asking how pre-defined functions get there in the first place,
the best way to model it is this: They are given by God.
Kent M Pitman <······@world.std.com> wrote in message news:<···············@shell01.TheWorld.com>...
> ·······@etang.com (attonie) writes:
>
> > i`m a lisp newbie,
>
> Welcome!
>
> > just think about the idear of lisp, puzzled at the define of base
> > function, so please tell me how the "plus" defined in lisp? thanks
>
> Perhaps you're looking for + ?
>
> It's already there. You just use it.
>
> (+ 1 2)
> => 3
>
> Or maybe you're asking how you would define PLUS given +? I guess
> if you wanted just a two-argument version you'd do:
>
> (defun plus (x y)
> (+ x y))
>
> or if you wanted a multi-argument version you'd do:
>
> (defun plus (&rest arguments)
> (apply #'+ arguments))
>
> If you're asking how pre-defined functions get there in the first place,
> the best way to model it is this: They are given by God.
yeah, i`m looking for pre-defined functions, did you know how many
pre-defined functions the lisp get from God, and what are thoes ? the
core is that i use what and how many Base-functions can deduce the
"real-world".
·······@etang.com (attonie) writes:
> yeah, i`m looking for pre-defined functions, did you know how many
> pre-defined functions the lisp get from God, and what are thoes ? the
> core is that i use what and how many Base-functions can deduce the
> "real-world".
Common Lisp has 978 pre-defined names, some of which are functions, some are
variables, and some have other semantic properties.
http://www.xanalys.com/software_tools/reference/HyperSpec/Body/01_i.htm