Dear Fabio,
One thing: here it is not a special case of csolver. You just misspelled the expression. So i will try to explain lisp basics and hope i will be as clear as i could:
-
(maybe you can skip this, but it is just a reminder)
In lisp you have either atoms or lists. So if it is not a list it is an atom.
we can use the atom function to test this :
(atom nil) => T
(atom 'some-symbol) => T
(atom 3) => T
(atom “moo”) => T
(atom (cons 1 2)) => NIL
(atom '(1 . 2)) => NIL
(atom '(1 2 3 4)) => NIL
(atom (list 1 2 3 4)) => NIL
-
Starting from this if you want to “transcribe” an om function in a lisp expression you should proceed so :
let’s take om+ function :
here we have two atoms
(om+ 3 4)
=> 7
Now we try with an atom and a list :
(om+ 3 '(3 4))
notice you should either use the quote in order that om+ accepts the '(3 4) as a list.
if you omit the quote, you’ll get illegal car WHY ?
Well without the quote, lisp will consider the car of the expression (yes it is an expression like (om+ 3 4) is an expression) to be either a function or a macro.
IMPORTANT: Because in lisp a function call is a list where the car of the list is either a function, method or a macro. So in order to consider '(3 4) as a list and not a function call to be evaluated, we should use a quote OR just make it an expression by using (list 3 4) …
-
So if we consider the default values of csolver (cf. screenshot) we will have
(csolver 8 '(|48_72|) '(3) '(2 7) nil '(1 3))
Because csolver takes 6 arguments
if you transcribe it as :
(csolver (8 '(|48_72|) '(3) '(2 7) nil '(1 3)))
this is wrong because the compiler will consider 8 as a function and tries to evaluate it.
and if you use it so :
(csolver '(8 '(|48_72|) '(3) '(2 7) nil '(1 3)))
or so :
(csolver (list 8 '(|48_72|) '(3) '(2 7) nil '(1 3)))
there will be just one argument to csolver method, and it requires 6 arguments.
Ok hope this was rather clear.
Best
K
