(defun creer-bagage (=poids =categorie)
(let* ((timestamp (get-universal-time))
(=id (format nil "~8d" (mod timestamp 100000000)))
(=dimensions
(case =categorie
(1 (list 3 3)) ;; Example dimensions for category 1
(2 (list 6 2)) ;; Example dimensions for category 2
(3 (list 6 3)) ;; Example dimensions for category 3
(otherwise (error "Catégorie invalide : ~a" =categorie)))))
;; Création du chunk en mémoire déclarative
)
(add-dm (isa baggage
id =id
categorie =categorie
poids =poids
dimensions =dimensions
position nil
est-place nil))
; (define-chunks-fct (("new chunk") isa bagage id =id))
)
When running this code with parameters say 1 and 1 I have this as result:
BAGGAGE0
ID =ID
CATEGORIE =CATEGORIE
POIDS =POIDS
DIMENSIONS =DIMENSIONS
So it does not pass the variables but instead treats them as strings. Please how do i fix it. Thanks
isaandadd-dm? Are you aware that(add-dm (isa baggage ;...occurs outside of theletform? It looks like you need to move the last parenth of theletform to be outside of the call toadd-dm.add-dmand how is it defined? I am guessing that it is a macro.