try
(defvar *fn-name* 'myadd)
(defvar *fn-args* '(x u))
(defvar *fn-body* '(+ x u))
(defun my-defun (fname arglist body)
(eval `(defun ,fname ,arglist ,body)))
and note, that excessive use of eval is regarded as bad style.
-wb
Abhijit Bose <·····@engin.umich.edu> writes:
> Hi all, How does one generate a new function definition in lisp by
> appending lists ?
> e.g. if I type :
>
> * (defvar fn_name 'myadd )
>
> FN_NAME
> * (defvar fn_args '(x u) )
>
> FN_ARGS
> * (defvar fn_body '(+ x u))
>
> FN_BODY
>
> Here it gets interesting - I would like to use something like :
> (defun fn_name fn_args fn_body)
USER(17): (defvar fn_name 'myadd )
FN_NAME
USER(18): (defvar fn_args '(x u) )
FN_ARGS
USER(19): (defvar fn_body '(+ x u))
FN_BODY
USER(20): (eval `(defun ,fn_name ,fn_args ,fn_body))
MYADD
USER(21): (myadd 2 3)
5
While you might think this is cool or something, I don't see how it's
useful. If you're thinking somehow that if you were to change the
value of something, like:
(setq fn_name 'new-myadd)
and then try calling that:
(new-myadd 2 3)
you would get an error.
What are you trying to accomplish?
Abhijit Bose <·····@engin.umich.edu> wrote:
+---------------
| Content-Type: text/plain
| Content-Transfer-Encoding: base64
|
| RGF2aWQsIFRoYW5rcyBmb3IgeW91ciByZXBseS4gVGhlIHJlYXNvbiBJIHdhbnQgdG8gZG8g
| dGhpcyBpcw0KaW50ZXJhY3RpdmUgZ2VuZXJhdGlvbiBvZiBmdW5jdGlvbnMsIGkuZS4gdGhl
| IHVzZXIgd2lsbCBydW4gc29tZSBsaXNwDQpmdW5jdGlvbiBhbmQgd2l0aGluIHRoYXQgZnVu
| Y3Rpb24sIHRoZSB1c2VyIGNhbiBpbnRlcmFjdGl2ZWx5IGdlbmVyYXRlDQpvdGhlciBmdW5j
+---- [...remainder deleted...] -----------
Could you *please* not do this when posting to newsgroups??!?
There's absolutely no reason to base64-encode plaintext... and
*many* reasons not to!
-Rob
-----
Rob Warnock, 31-2-510 ····@sgi.com
Network Engineering http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. PP-ASEL-IA
Mountain View, CA 94043
····@rigden.engr.sgi.com (Rob Warnock) writes:
> Abhijit Bose <·····@engin.umich.edu> wrote:
> +---------------
> | Content-Type: text/plain
> | Content-Transfer-Encoding: base64
> |
> | RGF2aWQsIFRoYW5rcyBmb3IgeW91ciByZXBseS4gVGhlIHJlYXNvbiBJIHdhbnQgdG8gZG8g
> | dGhpcyBpcw0KaW50ZXJhY3RpdmUgZ2VuZXJhdGlvbiBvZiBmdW5jdGlvbnMsIGkuZS4gdGhl
> | IHVzZXIgd2lsbCBydW4gc29tZSBsaXNwDQpmdW5jdGlvbiBhbmQgd2l0aGluIHRoYXQgZnVu
> | Y3Rpb24sIHRoZSB1c2VyIGNhbiBpbnRlcmFjdGl2ZWx5IGdlbmVyYXRlDQpvdGhlciBmdW5j
> +---- [...remainder deleted...] -----------
>
> Could you *please* not do this when posting to newsgroups??!?
> There's absolutely no reason to base64-encode plaintext... and
> *many* reasons not to!
Yeah. This would probably irritate me too, had I been using something
other than a relatively new version of Gnus.
If I were you, I'd download the newest version of Gnus, and use it. I
do think it's a shame that some (most, all?) of the usenet search
engines probably won't bother decoding this stuff when indexing.
dave
David Bakhash <·····@alum.mit.edu> writes:
> Yeah. This would probably irritate me too, had I been using something
> other than a relatively new version of Gnus.
It didn't irritate me, but that's just because our news server sent
it to the Great Bit Bucket In The Sky.
I assume that others have similar noise-reduction systems on their news
servers, so if the authour wants to be read by the whole community, he
must configure his news software correctly.
--
(espen)