Hello,
I have a "node" class which can contain different kinds of formulae
("and", "or"), so
(defstruct node
and
or)
Now I want to modify one of these members, passing its name as a
parameter:
(add-formula node1 'node-and formula1)
To do so, I would have to write a function like
(defun add-formula (nod set form)
(setf (eval set nod) (cons form (eval set nod))))
But the interpreter complains that "setf eval" was illegal.
(Allegro CL 6.0)
Why? And: How can I write a function that modifies the node this way
without having to use a long "case" statement like
(case set
(and (setf (node-and nod) (cons form (node-and nod))))
(or (setf (node-or ...
...
Thanks in advance,
Jan