Hello,
I’m having problems adding inputs to a lisp method without renaming the function. Lets take the example from the documentation page for user libraries:
(defmethod! Addition ((self list) (arg1 number))
:initvals '( 10 10 )
:indoc '(“First operand” “Second operand” )
:icon '(176)
:doc “Adds 2 things. Things can be numbers, lists, chords.”
(+ self arg1 ) )
I type option-y and test the function. Now I want to have more inputs, and type:
(defmethod! Addition ((self list) (arg1 number) (arg2 number))
:initvals '( 10 10 )
:indoc '(“First operand” “Second operand” )
:icon '(176)
:doc “Adds 2 things. Things can be numbers, lists, chords.”
(+ self arg1 ) )
When I try to evalute this, I get the error:
ERROR: Lambda list (self arg1 arg2) is not congruent with the lambda list (self arg) of #<omgenericfuntion addition 29C9BF0A>
But if I change the name of the method, it works:
(defmethod! Addition-3in ((self list) (arg1 number) (arg2 number))
:initvals '( 10 10 )
:indoc '(“First operand” “Second operand” )
:icon '(176)
:doc “Adds 2 things. Things can be numbers, lists, chords.”
(+ self arg1 ) )
It seems you always have to change the name if you want to redefine number of inputs. Indoc and intivals doesn’t seem to matter for the evaluation. I had problems working on a different function and tried a simple example. Do you know why it acts this way?
I also had problems adding :doc while keeping multiple outputs of a method, so I ended up removing the documentation. I should try to isolate this problem and give an example.
I’m still using Om 6.9.
Ruben