From: attonie
Subject: how lisp define the function "plus" ?
Date: 
Message-ID: <3f882dfa.0202220146.6cd4df1b@posting.google.com>
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

From: Kent M Pitman
Subject: Re: how lisp define the function "plus" ?
Date: 
Message-ID: <sfwg03t6atq.fsf@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.
From: attonie
Subject: Re: how lisp define the function "plus" ?
Date: 
Message-ID: <3f882dfa.0202232322.7e0d12e5@posting.google.com>
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".
From: Kent M Pitman
Subject: Re: how lisp define the function "plus" ?
Date: 
Message-ID: <sfwn0xzgrd1.fsf@shell01.TheWorld.com>
·······@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