When you sent this to  me off-list, I asked if you could provide a
complete program which showed the behavior you're describing, and let
me know what version of Jess we're talking about. I don't think you'll
get much advice without giving a way to reproduce this whole thing. As
it is, we don't know what ?*x1*, ?*x2*, or ?*x3* are, or how you're
calling these "modify" functions. Please don't just reply "they're
____" -- unless you show a complete, runnable program which displays
the issue, we won't understand what the problem is.

I think Antonino Lo Bue (gmail) wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
>  I've trouble with Jess foreach instruction because I want to prevent 
> duplicate/combination results:
> 
> Using this function
> (deffunction modify (?y ?z)
> (bind ?*x1* (insert$ ?*x1* 1 ?y) )
> (bind ?*x2* (insert$ ?*x2* 1 ?z) )
> (foreach ?e ?*x1* (bind ?*x3* (insert$ ?*x3* 1 (str-cat "Xpath_AVFOCUS" 
> (member$ ?e ?*x1*) "=" (nth$ (member$ ?e ?*x1*) ?*x1*)))  ))
> (foreach ?f ?*x2* (bind ?*x3* (insert$ ?*x3* 1 (str-cat "URI_LinkStanza" 
> (member$ ?f ?*x2*) "=" (nth$ (member$ ?f ?*x2*) ?*x2*)))  ))
> )
> 
> I obtain this result:
> ("URI_LinkStanza2=Video_1Particolare_2" 
> "URI_LinkStanza1=Video_1Particolare_1" "Xpath_AVFOCUS2=AVFocus_35" 
> "Xpath_AVFOCUS1=AVFocus_36" "URI_LinkStanza1=Video_1Particolare_2" 
> "Xpath_AVFOCUS1=AVFocus_35")
> 
> 
> but
> 
> using this
> (deffunction modify (?y ?z)
> (bind ?*x1* (insert$ ?*x1* 1 ?y) )
> (bind ?*x2* (insert$ ?*x2* 1 ?z) )
> )
> and writing this two code rows outside of function
> (foreach ?e ?*x1* (bind ?*x3* (insert$ ?*x3* 1 (str-cat "Xpath_AVFOCUS" 
> (member$ ?e ?*x1*) "=" (nth$ (member$ ?e ?*x1*) ?*x1*)))  ))
> (foreach ?f ?*x2* (bind ?*x3* (insert$ ?*x3* 1 (str-cat "URI_LinkStanza" 
> (member$ ?f ?*x2*) "=" (nth$ (member$ ?f ?*x2*) ?*x2*)))  ))
> 
> I obtain this (the right result without duplicate):
> ("URI_LinkStanza2=Video_1Particolare_2" 
> "URI_LinkStanza1=Video_1Particolare_1" "Xpath_AVFOCUS2=AVFocus_35" 
> "Xpath_AVFOCUS1=AVFocus_36")
> 
> 
> Any tips?
> 
> Thanks in advance
> 
> Antonino Lo Bue
> CNR-ICAR
> Palermo



---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to