### Equality of functions?

Posted:

**Sun Oct 14, 2012 12:17 am**Is there any way to compare equality of functions in LISP?

The following example explains what do I mean:

Let us define two functions:

>>>>> (defun next1 (x) (+ x 1) )

and

>>>>> (defun next2 (y) (+ y 1) )

Clearly, they do the same as functions and their formal definitions differ only by the name of

formal variable.

My question: is there a possibility in LISP to recognize that these functions are identical?

A simple test call (equalp next1 next2) results NIL...

The following example explains what do I mean:

Let us define two functions:

>>>>> (defun next1 (x) (+ x 1) )

and

>>>>> (defun next2 (y) (+ y 1) )

Clearly, they do the same as functions and their formal definitions differ only by the name of

formal variable.

My question: is there a possibility in LISP to recognize that these functions are identical?

A simple test call (equalp next1 next2) results NIL...