You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CLIPSESG
Hi
I have a fact which contains multifield value(strings), as you see in
the following fact (A B C B D A) there are two repeated strings (A ,
B), i wanna remove them. I mean my fact becomes like this: (A B C D).
There isn't any function to do it! I wanna write a rule which do this
work by a multislot variable. Is there any way to do it?
Any help is appreciated.
Thanks
(deffacts init-facts
(string (in A B C B D A ))
)
CLIPS Support
unread,
May 3, 2011, 9:02:55 PM5/3/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to CLIPSESG
CLIPS>
(deffunction remove-duplicates (?v)
(bind ?rv (create$))
(progn$ (?s ?v)
(if (not (member$ ?s ?rv))
then
(bind ?rv (create$ ?rv ?s))))
?rv)
CLIPS> (remove-duplicates (create$ A B C B D A))
(A B C D)
CLIPS>
Alireza
unread,
May 13, 2011, 3:32:53 PM5/13/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message