how to change clos slots
[email protected] (Pedro Kröger) Thu, 13 Mar 2008 12:37:58 -0300
| Newsgroups | gmane.lisp.lisa.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
As I wrote in the other email, my system will be analyzing chords
("sonorities") in a list. For now I decided to make a clos instance for
each sonority and put each of them in a list while I'm learning how to
write the rules, etc.
The code in http://paste.lisp.org/display/57289 is an oversimplification
of what I'm trying to do, but it's simpler to read then the one I'm
really writing. I'm creating 2 instances, one for each chord, in a list
and asserting them with loop:
(loop for ?s in *sonorities* do
(assert (?s)))
rule-1 is a just for testing. it matches ok for both versions in:
http://paste.lisp.org/display/57289#1
(the result of running (test) with (watch :all) is in)
http://paste.lisp.org/display/57289#3
but what I want to do is to change the slots of each instance. I tried
the following code but I get a infinite loop:
(defrule rule-1 ()
(?sonority (sonority (notes ?notes)))
=>
(modify ?sonority (tertian-p t)))
So, after runing (test) I should get (T T) after evaluating:
(mapcar #'tertian-p *sonorities*)
Any ideas?
Pedro
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/