On Wed, Dec 23, 2009 at 09:41:08AM +0800, cle wrote:
> > hmm, you could stick with 'solve' (as you did in a previous version):
> > (be findall (@Var @Pred @Result)
> > (@Result solve
> > (list (-> @Pred))
> > (or (val '@Var) (fill (-> @Var))) ) )
> Yeah! I like this a lot better :-D That prove you again being the guru
> and me the disciple :-)
Not at all! I must say your discovery of using 'fill' here is ingenious.
A nice coincidence of Lisp pattern variables versus Pilog variables.
I would suggest two changes:
1. '@Var' is not always a variable, but may be any kind of pattern. So
let's better call it '@Pat'.
2. (val '@Var) is a tautology. Just @Var (or @Pat) should suffice. With
that, we would get
(be findall (@Pat @P @Res)
(or @Pat (fill (-> @Pat))) ) )
What do you think?