Thanks Alex, About the "filtering with a no-op" - that was my way of getting rid of NIL's in the list - what's the right way :) ?
Regards, Kashyap On Thu, Dec 5, 2019 at 7:50 AM Alexander Burger <[email protected]> wrote: > Hi Kashyap, > > > The question I have now is about cases where we may need a couple of > pilog > > variables of the form - > > @Names XXX > > @Gen (mapcan '((Nm) (list 'nm '+TagNm Nm)) 'XXX) > > > > where XXX needs to be substituted with an expression - (filter '((X) X) > > (mapcar '((X) (uppc (pack X))) *Tags))) in this case. As I was > > experimenting for writing this email, using function calls to do the > > "substitution" seems to work. For some reason, it was not working for me > > when I tried yesterday. > > Yeah, this should be no general problem. In all those patterns > > @Var (expression) > > (expression) is an arbitrary Lisp expression, so you are completely free > to call > other functions etc. > > > > This seems to work too - > > '( > > @Names (YY) > > @Gen (mapcan '((Nm) (list 'nm '+TagNm Nm)) '(YY T)) > > (select (@@) > > ((@Gen (nm +Tag) tsk)) > > (^ @ > > (fully > > '((Nm) > > (find > > '((This) (member Nm (: nm nm))) > > (; (-> @@) tgs) ) ) > > (-> @Names) ) ) > > ) > > ) > > > > where YY is defined as - > > Well, in the above @Gen expression, 'YY' is used as a *name* in the quoted > list, > so it does not matter if and how it is defined. > > Or is the quote wrong? > > > > (de YY (QT) > > (filter '((X) X) (mapcar '((X) (uppc (pack X))) *Tags))) > > One thing odd I find is that the code "does not work" when I call YY with > > NIL or without an argument in the second case (@Gen) > > The 'QT' parameter is ignored anyway. > > Side note: Why do you filter with a no-op function? Or is this just a > placeholder for testing? > > > ☺/ A!ex > > -- > UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe >
