[Lisp] Variable considérée comme une fonction
Salut à tous! :)
J'ai un projet lisp pour mes cours et là je bloque.
Une variable déclarée avec setq est apparement considée comme un fonction.
Voilà le code:
Code:
1 2 3 4 5 6 7 8 9 10
| (defmethod rapprocher-nourriture-m ((a mouton))
(write "on essaie de se rapprocher")(terpri)
(setq lign1 (round(/(-(lig(nourriture-proche a 4))(lig a)) 2)))
(setq colon1 (round(/(-(col(nourriture-proche a 4))(col a)) 2)))
(setq qqun (?qui2 (ligne1 colon1)))
(if qqun
(errer-m)
( (setf (lig a) lign1) (setf(col a) colon1) ) ;<- l'erreur semble venir d'ici
)
) |
renvoi l'erreur suivant lorsque je load:
Citation:
** - Continuable Error
SYSTEM::%EXPAND-FORM : (SETF (LIG A) LIGN1) devrait être une expression LAMBDA
Si vous continuez (en tapant «continue»): Reéssayer
The following restarts are also available:
STORE-VALUE :R1 You may input a new value for LIGNE1.
USE-VALUE :R2 You may input a value to be used instead of LIGNE1.
STORE-VALUE :R3 You may input a new value for (FDEFINITION 'LIGN1).
USE-VALUE :R4 You may input a value to be used instead of (FDEFINITION 'LIGN1).
STORE-VALUE :R5 You may input a new value for (SLOT-VALUE #<MOUTON #x2042D77E> HORLOGE-I).
USE-VALUE :R6 You may input a value to be used instead of (SLOT-VALUE #<MOUTON #x2042D77E> HORLOGE-I).
CONTINUE :R7 Reéssayer
STORE-VALUE :R8 You may input a new value for (FDEFINITION 'LIGN1).
USE-VALUE :R9 You may input a value to be used instead of (FDEFINITION 'LIGN1).
CONTINUE :R10 Reéssayer
STORE-VALUE :R11 You may input a new value for (FDEFINITION 'LIGNE).
USE-VALUE :R12 You may input a value to be used instead of (FDEFINITION 'LIGNE).
CONTINUE :R13 Reéssayer
STORE-VALUE :R14 You may input a new value for (FDEFINITION 'LIGN).
USE-VALUE :R15 You may input a value to be used instead of (FDEFINITION 'LIGN).
USE-VALUE :R16 You may input a value to be used instead.
STORE-VALUE :R17 You may input a new value for ?QUI2.
USE-VALUE :R18 You may input a value to be used instead of ?QUI2.
STORE-VALUE :R19 You may input a new value for ?QUI2.
USE-VALUE :R20 You may input a value to be used instead of ?QUI2.
STORE-VALUE :R21 You may input a new value for QUI2.
USE-VALUE :R22 You may input a value to be used instead of QUI2.
merci d'avance :)