I think there's a bug with the ‘member$’ function when it's used on a list that comes from a fact. Th following code :
(defrulestart=>(assert(recoupeNomFamillenoms_recoupesxmere"CROCI")))(defruletest?f<-(recoupeNomFamillenoms_recoupes?x?parent$?noms_recoupes)=>(printoutt"----- length$ of ?noms_recoupes="?noms_recoupes" : "(length$?noms_recoupes)crlf)(printoutt"----- START of progn$ on ?noms_recoupes="?noms_recoupes" (with varaible ?n)"crlf)(progn$(?n?noms_recoupes)(printoutt"----- n-index="?n-index" n="?ncrlf))(printoutt"----- END of progn$"crlf)(printoutt"----- this length$ and this progn$ show that ?nom_recoupes has exactly one element"crlf)(printoutt"----- call of member$ : (member$ \"CROCI\" ?noms_recoupes)=(member$ \"CROCI\" "?noms_recoupes")="(member$"CROCI"?noms_recoupes)crlf))
prints
FIRE 1 start: *
==> f-1 (recoupeNomFamille noms_recoupes x mere "CROCI")
==> Activation 0 test: f-1
FIRE 2 test: f-1
----- length$ of ?noms_recoupes=("CROCI") : 1
----- START of progn$ on ?noms_recoupes=("CROCI") (with varaible ?n)
----- n-index=1 n=CROCI
----- END of progn$
----- this length$ and this progn$ show that ?nom_recoupes has exactly one element
----- call of member$ : (member$ "CROCI" ?noms_recoupes)=(member$ "CROCI" ("CROCI"))=4
<== Focus MAIN
I was expecting 1 and not 4
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I think there's a bug with the ‘member$’ function when it's used on a list that comes from a fact. Th following code :
prints
I was expecting 1 and not 4
I checked in a fix for this bug.
Thank you for the fix. It works fine.