From: Kareem Nutt
Subject: Define A Function Within A Function
Date: 
Message-ID: <K-GdnXiuU6tXicXcRVn-pw@comcast.com>
Is it possible to create a function within a function with the original 
passed arguments?  Example:

(defun new-func (new-func-name arg1)
	(defun new-func-name (arg1)
		(...body...)))

I've tried doing it, but the new function doesn't take the variables, 
just the explicit names - (above, it will create a function named 
new-func-name regardless of what is passed).

Also, what if arg1 is passed as a list: '(a b c) and I want 
new-func-name to have the three arguments of a b c (not the  list)? 
This would be like:

(new-func 'new-name '(a b c)) -> (NEW-NAME A B C)

Thanks a lot for all the help.  I really appreciate it.

From: Kareem Nutt
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <IeudnaQLJNtQ9MXcRVn-vQ@comcast.com>
I guess I need to explain what I'm doing a bit
further.
I have a function: (generate-call-pattern func-name labels args output) 
-> returns the correct order of a given function with the labels and 
argumetns.
Example:
(generate-call-pattern 'expt '(power base) '(3 2) 8) -> (EXPT BASE POWER)
I would like the user to be able to define their own variation of a 
given function.  Example:
(create-function-variation 'expt '(power base) '(3 2) 8 'my-expt) -> MY-EXPT
(my-expt 3 2) -> 8

That's why I wanted:
(defun create-function-variation (func-name labels args output 
new-func-name)
    (eval `(defun ,new-func-name (,@labels)
       (generate-call-pattern ',func-name ',labels ',args ,output))))

What I get from this (which I don't want) is:
(create-function-variation 'expt '(power base) '(3 2) 8 'my-expt)
MY-EXPT
(my-expt 3 2)
(EXPT BASE POWER)

I have a feeling that I'm following the wrong path.  Any ideas?
From: Harald Hanche-Olsen
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <pcou0tjmntb.fsf@shuttle.math.ntnu.no>
+ Kareem Nutt <··········@gmail.com>:

| I guess I need to explain what I'm doing a bit
| further.
| I have a function: (generate-call-pattern func-name labels args
| output) -> returns the correct order of a given function with the
| labels and argumetns.

Whenever you get hung up on argument order, it's probably a better
idea to convert to keyword arguments.  It makes clearer code, and
users can list the argument in whatever order they feel like.

But I'll ignore this and play along with you on this.

| Example:
| (generate-call-pattern 'expt '(power base) '(3 2) 8) -> (EXPT BASE POWER)
| I would like the user to be able to define their own variation of a
| given function.  Example:
| (create-function-variation 'expt '(power base) '(3 2) 8 'my-expt) -> MY-EXPT
| (my-expt 3 2) -> 8
| 
| That's why I wanted:
| (defun create-function-variation (func-name labels args output
| new-func-name)
|     (eval `(defun ,new-func-name (,@labels)
|        (generate-call-pattern ',func-name ',labels ',args ,output))))

This really sounds like a job for a macro.  You are writing code that
is writing code, and this is what macros are for.  Never use EVAL
unless you are doing system hacking.  (Slime is an excellent example
of a package that needs to use EVAL, but most of us should never touch
this function.)

Something like

(defmacro create-function-variation
    (func-name labels args output new-func-name)
  `(defun ,new-func-name (,@labels)
    ,(generate-call-pattern `',func-name `',labels `',args output)))

unless I have completely misunderstood your intentions (a distinct
possibility).

The inner combinations of backquotes, quotes and commas may look
confusing, but I think it beats (list 'quote funcname) etc.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
  than thinking does: but it deprives us of whatever chance there is
  of getting closer to the truth.  -- C.P. Snow
From: Kareem Nutt
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <IeudnT-4wdMUHMXcRVn-uQ@comcast.com>
Harald Hanche-Olsen wrote:

> + Kareem Nutt <··········@gmail.com>:
> 
> | I guess I need to explain what I'm doing a bit
> | further.
> | I have a function: (generate-call-pattern func-name labels args
> | output) -> returns the correct order of a given function with the
> | labels and argumetns.
> 
> Whenever you get hung up on argument order, it's probably a better
> idea to convert to keyword arguments.  It makes clearer code, and
> users can list the argument in whatever order they feel like.
> 
> But I'll ignore this and play along with you on this.
> 
> | Example:
> | (generate-call-pattern 'expt '(power base) '(3 2) 8) -> (EXPT BASE POWER)
> | I would like the user to be able to define their own variation of a
> | given function.  Example:
> | (create-function-variation 'expt '(power base) '(3 2) 8 'my-expt) -> MY-EXPT
> | (my-expt 3 2) -> 8
> | 
> | That's why I wanted:
> | (defun create-function-variation (func-name labels args output
> | new-func-name)
> |     (eval `(defun ,new-func-name (,@labels)
> |        (generate-call-pattern ',func-name ',labels ',args ,output))))
> 
> This really sounds like a job for a macro.  You are writing code that
> is writing code, and this is what macros are for.  Never use EVAL
> unless you are doing system hacking.  (Slime is an excellent example
> of a package that needs to use EVAL, but most of us should never touch
> this function.)
> 
> Something like
> 
> (defmacro create-function-variation
>     (func-name labels args output new-func-name)
>   `(defun ,new-func-name (,@labels)
>     ,(generate-call-pattern `',func-name `',labels `',args output)))
> 
> unless I have completely misunderstood your intentions (a distinct
> possibility).
> 
> The inner combinations of backquotes, quotes and commas may look
> confusing, but I think it beats (list 'quote funcname) etc.
> 

I started playing around with marcos and it seems like this is the way I 
I should be headed.  What you have is what I'm trying to accomplish. 
However, upon running it, I get "Error: Illegal function object: 
''EXPT."  I've gotten this a lot recently because of the backquotes and 
commas.  Is there something wrong with the  (defmacro ...) statement above?
From: Harald Hanche-Olsen
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <pcois9zmm6l.fsf@shuttle.math.ntnu.no>
+ Kareem Nutt <··········@gmail.com>:

| Is there something wrong with the (defmacro ...) statement above?

Quite possibly, since I didn't test it (and couldn't because I did not
have access to your GENERATE-CALL-PATTERN function).  Try running

(macroexpand-1
  '(create-function-variation 'expt '(power base) '(3 2) 8 'my-expt))

and see if the output fits your expectations.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
  than thinking does: but it deprives us of whatever chance there is
  of getting closer to the truth.  -- C.P. Snow
From: Kareem Nutt
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <mrydncZ5U7sjF8XcRVn-pQ@comcast.com>
same error message.  i'm not sure where to go from here.  it seems lieke 
macros should be working, but there seems to be something simple i'm 
missing.

here's the code for all the functions that make generate-call-pattern 
work if that helps at all.  again, thanks a lot for your help.

(defun permutations (bag)
   (if (null bag)
       '(())
     (mapcan #'(lambda (e)
                 (mapcar #'(lambda (p) (cons e p))
                   (permutations
                    (remove e bag :count 1 :test #'eq))))
       bag)))
---

(defun generate-call-pattern (func-name labels args output)
   (mapcan #'(lambda (param)
               (when (equal (apply func-name param) output)
               (cons func-name (match-result param (make-ref-list args 
labels)))))
     (permutations args)))

----

(defun match-result (pattern ref-list)
   (if (null (rest pattern))
       (list (rest (assoc (first pattern) ref-list)))
     (cons (rest (assoc (first pattern) ref-list)) (match-result (rest 
pattern) ref-list))))

----

(defun make-ref-list (key value)
   (if (or (null (rest key)) (null (rest value)))
       (acons (first key) (first value) NIL)
     (acons (first key) (first value) (make-ref-list (rest key) (rest 
value)))))
From: Kenny Tilton
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <_306d.147177$4h7.24822882@twister.nyc.rr.com>
Kareem Nutt wrote:
> same error message.  i'm not sure where to go from here. 

Look for some tips from me in another thread about debugging macros with 
print statements which run during macroexpansion. You need those if the 
macroexpansion itself fails. Note that I chopped a lot of quotes from 
your input, as well as a lot of `',stuff from the macro.

oh, and next time post the whole wadge, including how you were testing. 
i had to search back through the thread to find that.

kenny

(defun permutations (bag)
   (if (null bag)
       '(())
     (mapcan #'(lambda (e)
                 (mapcar #'(lambda (p) (cons e p))
                   (permutations
                    (remove e bag :count 1 :test #'eq))))
       bag)))

(defun match-result (pattern ref-list)
   (if (null (rest pattern))
       (list (rest (assoc (first pattern) ref-list)))
     (cons (rest (assoc (first pattern) ref-list)) (match-result (rest 
pattern) ref-list))))

(defun make-ref-list (key value)
   (if (or (null (rest key)) (null (rest value)))
       (acons (first key) (first value) NIL)
     (acons (first key) (first value) (make-ref-list (rest key) (rest 
value)))))

(defun generate-call-pattern (func-name labels args output)
   (mapcan #'(lambda (param)
               (when (equal (apply func-name param) output)
               (cons func-name (match-result param (make-ref-list args 
labels)))))
     (permutations args)))

(defmacro create-function-variation
     (func-name labels args output new-func-name)
   `(defun ,new-func-name (,@labels)
     ,(generate-call-pattern func-name labels args output)))

#+test
(generate-call-pattern 'expt '(power base) '(3 2) 8)
;; => (EXPT BASE POWER)

(create-function-variation expt (power base) (3 2) 8 my-expt)
;; =>  (DEFUN MY-EXPT (POWER BASE) (EXPT BASE POWER))

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: Matthew Danish
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <87ekkn5hxk.fsf@mapcar.org>
Here is a functional version, with some additional suggestions.

Kenny Tilton <·······@nyc.rr.com> writes:
> (defun permutations (bag)
>    (if (null bag)
>        '(())
>      (mapcan #'(lambda (e)
>                  (mapcar #'(lambda (p) (cons e p))
>                    (permutations
>                     (remove e bag :count 1 :test #'eq))))
>        bag)))
>
> (defun match-result (pattern ref-list)
>    (if (null (rest pattern))
>        (list (rest (assoc (first pattern) ref-list)))
>      (cons (rest (assoc (first pattern) ref-list)) (match-result (rest
> pattern) ref-list))))

;; much cleaner
(defun match-result (pattern ref-list)
  (loop for x in pattern collect (cdr (assoc x ref-list))))

;; or
(defun match-result (pattern ref-list)
  (mapcar #'(lambda (x)
              (cdr (assoc x ref-list)))
          pattern))

> (defun make-ref-list (key value)
>    (if (or (null (rest key)) (null (rest value)))
>        (acons (first key) (first value) NIL)
>      (acons (first key) (first value) (make-ref-list (rest key) (rest
> value)))))

;; again, cleaner
(defun make-ref-list (key value)
  (mapcar #'cons key value))

> (defun generate-call-pattern (func-name labels args output)
>    (mapcan #'(lambda (param)
>                (when (equal (apply func-name param) output)
>                (cons func-name (match-result param (make-ref-list args
> labels)))))
>      (permutations args)))

;; test should be a parameter; equal is not sufficient for all kinds
;; of objects
(defun generate-call-pattern (old-fn args output &key (test 'equal))
  (let ((indices (loop for n from 0 below (length args) collect n)))
    (loop for cur-args in (permutations args)
          when (funcall test (apply old-fn cur-args) output)
          return (match-result cur-args
                               (make-ref-list args indices)))))

> (defmacro create-function-variation
>      (func-name labels args output new-func-name)
>    `(defun ,new-func-name (,@labels)
>      ,(generate-call-pattern func-name labels args output)))

(defun create-function-variation (old-fn args output &key (test 'equal))
  (let ((call-pattern (generate-call-pattern old-fn args output
                                             :test test)))
    #'(lambda (&rest params)
        (let ((new-params
               (loop for n in call-pattern collect (elt params n))))
          (apply old-fn new-params)))))

(funcall (create-function-variation 'expt '(3 2) 8) 3 2)  ; => 8

(setf (symbol-function 'my-expt)
      (create-function-variation 'expt '(3 2) 8))

(my-expt 3 2)  ; => 8

-- 
;; Matthew Danish -- user: mrd domain: cmu.edu
;; OpenPGP public key: C24B6010 on keyring.debian.org
From: Kenny Tilton
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <dq46d.147383$4h7.24923146@twister.nyc.rr.com>
Matthew Danish wrote:

> Here is a functional version, with some additional suggestions.
> 
> Kenny Tilton <·······@nyc.rr.com> writes:
> 
>>(defmacro create-function-variation
>>     (func-name labels args output new-func-name)
>>   `(defun ,new-func-name (,@labels)
>>     ,(generate-call-pattern func-name labels args output)))
> 
> 
> (defun create-function-variation (old-fn args output &key (test 'equal))
>   (let ((call-pattern (generate-call-pattern old-fn args output
>                                              :test test)))
>     #'(lambda (&rest params)
>         (let ((new-params
>                (loop for n in call-pattern collect (elt params n))))
>           (apply old-fn new-params)))))
> 
> (funcall (create-function-variation 'expt '(3 2) 8) 3 2)  ; => 8
> 
> (setf (symbol-function 'my-expt)
>       (create-function-variation 'expt '(3 2) 8))

I have not been staring at this too closely, I just debugged the macro. 
Is this second approach any different than using defmacro? I had not 
picked up on the need for funcalling, but mebbe I just missed that 
requirement. It is a nice demo, tho, of the capabilities of Lisp.

kenny

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: Matthew Danish
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <877jqfdnd2.fsf@mapcar.org>
Kenny Tilton <·······@nyc.rr.com> writes:
> I have not been staring at this too closely, I just debugged the
> macro. Is this second approach any different than using defmacro? I
> had not picked up on the need for funcalling, but mebbe I just missed
> that requirement. It is a nice demo, tho, of the capabilities of Lisp.

The major difference, of course, is that it operates at run-time
instead of compile-time.  This means that further ``variations'' could
be created at run-time without invoking the compiler.  This may or may
not be desired; there is some additional overhead involved in this
approach which the macro elides.

-- 
;; Matthew Danish -- user: mrd domain: cmu.edu
;; OpenPGP public key: C24B6010 on keyring.debian.org
From: Thomas A. Russ
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <ymi8yaub5sd.fsf@sevak.isi.edu>
Matthew Danish <··········@cmu.edu> writes:

> 
> Kenny Tilton <·······@nyc.rr.com> writes:
> > I have not been staring at this too closely, I just debugged the
> > macro. Is this second approach any different than using defmacro? I
> > had not picked up on the need for funcalling, but mebbe I just missed
> > that requirement. It is a nice demo, tho, of the capabilities of Lisp.
> 
> The major difference, of course, is that it operates at run-time
> instead of compile-time.  This means that further ``variations'' could
> be created at run-time without invoking the compiler.  This may or may
> not be desired; there is some additional overhead involved in this
> approach which the macro elides.

Of course, just because the variations happen at run-time, doesn't mean
that one CAN'T invoke the compiler.  Our Loom knowledge representation
system would generate functions in response to definitions and then
call the compiler on them before storing the resulting code.

One could use the following step instead of the (setf (symbol-function...))

(compile 'my-expt
         (create-function-variation 'expt '(3 2) 8))

and get compiled code instead.


-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Matthew Danish
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <873c12dtw8.fsf@mapcar.org>
···@sevak.isi.edu (Thomas A. Russ) writes:
> Of course, just because the variations happen at run-time, doesn't mean
> that one CAN'T invoke the compiler.  Our Loom knowledge representation
> system would generate functions in response to definitions and then
> call the compiler on them before storing the resulting code.
> 
> One could use the following step instead of the (setf (symbol-function...))
> 
> (compile 'my-expt
>          (create-function-variation 'expt '(3 2) 8))
> 
> and get compiled code instead.

You are confused.  My version is no less compiled than the other
version; I use closures instead of generating new code.  But I cannot
fiddle with lexical variables at run-time, since they no longer exist.
So I must instead use a &rest parameter and cons up a list of
re-ordered arguments.  This can be optimized somewhat, but does
introduce overhead which the macro-version neatly steps aside by
manipulating lexical variables.  I did not mean to exclude the
possibility of using the compiler at run-time, just to point out that
it is unnecessary.

P.S.  I don't know how Loom works, but you certainly do not need to
invoke the compiler on the result of a higher-order function.  I doubt
that this is what Loom is doing, however.

-- 
;; Matthew Danish -- user: mrd domain: cmu.edu
;; OpenPGP public key: C24B6010 on keyring.debian.org
From: Thomas A. Russ
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <ymi4qlfbokj.fsf@sevak.isi.edu>
Matthew Danish <··········@cmu.edu> writes:

Matthew Danish <··········@cmu.edu> writes:

> You are confused.  My version is no less compiled than the other
> version; I use closures instead of generating new code.

I guess I didn't look closely enough at what exactly the code
was doing.  Using closures will, of course, solve the compilation issue.

> P.S.  I don't know how Loom works, but you certainly do not need to
> invoke the compiler on the result of a higher-order function.  I doubt
> that this is what Loom is doing, however.

No.  Loom is generating the actual function code as a lambda expression
and then compiling it.  So the actual code formation is done at run time.

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Pascal Bourguignon
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <87sm93v0kd.fsf@thalassa.informatimago.com>
Kareem Nutt <··········@gmail.com> writes:

> I guess I need to explain what I'm doing a bit
> further.
> I have a function: (generate-call-pattern func-name labels args
> output) -> returns the correct order of a given function with the
> labels and argumetns.
> Example:
> (generate-call-pattern 'expt '(power base) '(3 2) 8) -> (EXPT BASE POWER)
> I would like the user to be able to define their own variation of a
> given function.  Example:
> (create-function-variation 'expt '(power base) '(3 2) 8 'my-expt) -> MY-EXPT
> (my-expt 3 2) -> 8
> 
> That's why I wanted:
> (defun create-function-variation (func-name labels args output
> new-func-name)
>     (eval `(defun ,new-func-name (,@labels)
>        (generate-call-pattern ',func-name ',labels ',args ,output))))
> 
> What I get from this (which I don't want) is:
> (create-function-variation 'expt '(power base) '(3 2) 8 'my-expt)
> MY-EXPT
> (my-expt 3 2)
> (EXPT BASE POWER)
> 
> I have a feeling that I'm following the wrong path.  Any ideas?

What should be the body of your new-func ???

Do you want the function named new-func-name to call the function
generate-call-pattern, or do rather want it to evaluate the expression
returned by generate-call-pattern?  If so, why don't you write what you mean?

(defun create-function-variation (func-name labels args output new-func-name)
    (eval `(defun ,new-func-name ,labels
             ,(generate-call-pattern func-name labels args output))))

You may use PRINT instead of EVAL to see what you're doing.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.
From: Kareem Nutt
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <kKWdnQBrLtPsE8XcRVn-uQ@comcast.com>
> What should be the body of your new-func ???
> 
> Do you want the function named new-func-name to call the function
> generate-call-pattern, or do rather want it to evaluate the expression
> returned by generate-call-pattern?  If so, why don't you write what you mean?
> 
> (defun create-function-variation (func-name labels args output new-func-name)
>     (eval `(defun ,new-func-name ,labels
>              ,(generate-call-pattern func-name labels args output))))
> 
> You may use PRINT instead of EVAL to see what you're doing

Ah, I see what my problem was.  You were totally right - I was doing the 
wrong thing.  I wanted the new function to evaluate the function instead 
of calling it.  That helps a ton.  Again, my many thanks.
From: marco
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <m2llevq0dw.fsf@bese.it>
Kareem Nutt <··········@gmail.com> writes:

> Thanks a lot for all the help.  I really appreciate it.

i don't really know what you're trying to do and i think you should
use a hash table instead of the function name space. having said that
here's how you do what you said you want:

(defmacro define-function (macro-args)
  ...
  `(defun ,name ,func-args ,@func-body))

-- 
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
     -Leonard Cohen
From: Kalle Olavi Niemitalo
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <87mzzbzsjz.fsf@Astalo.kon.iki.fi>
Kareem Nutt <··········@gmail.com> writes:

> Is it possible to create a function within a function with the
> original passed arguments?  Example:
>
> (defun new-func (new-func-name arg1)
> 	(defun new-func-name (arg1)
> 		(...body...)))

Here are a few ways.

  (defun new-func (new-func-name parameter-name)
    (eval `(defun ,new-func-name (,parameter-name)
             (...body...))))

  (defun new-func (new-func-name parameter-name)
    (setf (fdefinition new-func-name)
          (coerce `(lambda (,parameter-name)
                     (...body....))
                  'function)))

  (defun new-func (new-func-name parameter-name)
    (fmakunbound new-func-name)         ; in case it names a macro
    (compile new-func-name `(lambda (,parameter-name)
                              (...body...))))

However, it seems very strange to me that new-func takes
PARAMETER-NAME as a parameter but not the body.  How is the
parameter going to be used in the body?
 
All of these schemes are likely to hinder tree shakers.
Can you use a macro instead?

> Also, what if arg1 is passed as a list: '(a b c) and I want
> new-func-name to have the three arguments of a b c (not the  list)?

Use ,@lambda-list instead of ,parameter-name.
From: Pascal Bourguignon
Subject: Re: Define A Function Within A Function
Date: 
Message-ID: <87y8ivv8b1.fsf@thalassa.informatimago.com>
Kalle Olavi Niemitalo <···@iki.fi> writes:

> Kareem Nutt <··········@gmail.com> writes:
> 
> > Is it possible to create a function within a function with the
> > original passed arguments?  Example:
> >
> > (defun new-func (new-func-name arg1)
> > 	(defun new-func-name (arg1)
> > 		(...body...)))
> 
> Here are a few ways.
> 
>   (defun new-func (new-func-name parameter-name)
>     (eval `(defun ,new-func-name (,parameter-name)
>              (...body...))))
> 
>   (defun new-func (new-func-name parameter-name)
>     (setf (fdefinition new-func-name)
>           (coerce `(lambda (,parameter-name)
>                      (...body....))
>                   'function)))
> 
>   (defun new-func (new-func-name parameter-name)
>     (fmakunbound new-func-name)         ; in case it names a macro
>     (compile new-func-name `(lambda (,parameter-name)
>                               (...body...))))


However, it's perfectly possible to use defun inside a defun:

[66]> (defun definer (x) (defun getter () x))
DEFINER
[67]> (definer 2)
GETTER
[68]> (getter)
2
[69]> (definer 3)
GETTER
[70]> (getter)
3
[71]>  

Of course, since defun is a macro that does not evaluate its function
name argument, you cannot generate the defined function name inside
your definer function.  But the closure attached to that name can
change from one invocation to the other of the definer function.

[And if you wanted local functions, use flet or labels:

    (defun big-function (x)
        (flet ((add1 (y) (+ y 1))
               (sub1 (y) (- y 1)))
            (* (add1 x) (sub1 x))))

]

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.