OK, thanks a lot - now it works. Somewhat cumbersome but OK.
Summarizing, that's how it works:

  ...
  (defadvice before format (bind $?argv (create$ format t ?fmt
$?parms)))
  (format)
  (undefadvice format)
  ...

Regards,
        tge

friedman_hill ernest j wrote:
> 
> Your defadvice call is assuming that $?argv is supposed to contain
> just the parameters to the function, but actually it's the entire
> function call. The description in the manual is actually quite
> ambiguous so I will fix the wording. In any event, your defadvice
> works fine with the addition of the atom "format" immediately after
> "create$".
> 
> I think Thomas Gentsch wrote:
> >
> > Another question ... :~)
> >
> > In CLIPS there is a feature which expands multifield variables into
> > single function parameters. The following example illustrates that best:
> >
> > (bind ?m (create$ a b c))
> > (format t "1: %s 2: %s 3: %s\n" $?m)
> >
> > i.e. by specifying the $ the multifield will be expanded.
> > Basically that equals (nth$ 1 ?m) (nth$ 2 ?m) (nth$ 3 ?m) in that case
> > but much simpler. Is there any way to do that in Jess?
> >
> > Btw. I experimented with the (defadvice ) and tried this:
> >   (defadvice before format (bind $?argv (create$ t "1: %s 2: %s 3: %s\n"
> > $?m)))
> >   (format)
> >   (undefadvice format)
> >
> > but that ignored for some reason the 't' (or nil or whatever I
> > specified) and complained:
> >   Message: Bad router 1: %s 2: %s 3: %s
> >
> > Or
> >   (defadvice before format (bind $?argv (create$ $?argv)))
> >   (format t "1: %s 2: %s 3: %s\n" $?m)
> >   (undefadvice format)
> > results in
> >   Message: Not a string: "a b c" (type = LIST).
> >
> > which is the same error as if I call the function as on the very top
> > (which is OK assuming that the multifield does not get expanded).
> >
> > I also tried all variations I could think of but couldn't get it to
> > work. Any advice :~) ??
> >
> > Thanks a lot,
> >       tge
> >
> > --
> >      Thomas Gentsch
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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]
> > ---------------------------------------------------------------------
> >
> 
> ---------------------------------------------------------
> Ernest Friedman-Hill
> Distributed Systems Research        Phone: (925) 294-2154
> Sandia National Labs                FAX:   (925) 294-2234
> Org. 8920, MS 9012                  [EMAIL PROTECTED]
> PO Box 969                  http://herzberg.ca.sandia.gov
> Livermore, CA 94550

-- 
          Thomas Gentsch



---------------------------------------------------------------------
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