Re: pl-iterator

Thomas Russ <[email protected]> Mon, 5 Nov 2007 10:07:38 -0800
Newsgroups gmane.comp.ai.powerloom
Message-ID <[email protected]>
On Nov 4, 2007, at 11:47 AM, Magnus Malm wrote:

> Hello
>
> I get an error while using next? and %%value on pl-iterators. I  
> have the following in my kb:
>
> If I try to run a function using next? and %%value, like so:

The proper name for the accessor function is %value (with only one  
"%" character).
Also, the environment argument to S-RETRIEVE is not a string, so you  
should pass stella::null instead of stella::null-string as the null  
value.

>
> (defun foo ()
>   (pli:load "/home/magnus/src/powerloom-3.2.15/kbs/peis.plm" nil)
>   (pli:change-module "PEIS")
>
>   (let* ((iter (pli:s-retrieve "all (component ?x)" stella::null- 
> string
>                    stella::null-string)))
>     (loop while (stella::next? iter) do
>      (print (stella::%%value iter)))))
>