Hi Kashyap

Try: (rel tgs (+List +Ref +Joint) NIL itm (+Tag))

+Idx is for +String, actually a special variant of the general
non-unique index +Ref.
Be aware that the relation classes may have parameters - in same order
as the prefix classes:
(rel <rel-name> (<Prefix-Class-1> <Prefix-Class-2> ... <Type-Class>)
<Prefix-Class-1-Argument> <Prefix-Class-2-Argument> ...
<Type-Class-Argument>)

Now I'm currently unsure if +Ref and +Joint can be combined... might be
that +Joint cannot be indexed?
Alex?

Regards,
beneroth

On 23.11.19 16:49, C K Kashyap wrote:
> Thanks Alex,
> How can I add +Idx to tgs? That should be possible right?
> When I add +Idx to tgs, I get "tgs -- No Link" error.
> Regards,
> Kashyap
>
> On Fri, Nov 22, 2019 at 11:07 PM Alexander Burger <a...@software-lab.de
> <mailto:a...@software-lab.de>> wrote:
>
>     Hi Kashyap,
>
>     >  (collect 'tgs '+Item (db 'nm '+Tag "BLUE")) does not seem to
>     work for me -
>
>     Sorry, my fault! I did not test.
>
>     > returns NIL. For that matter, even (collect 'tgs '+Item) returns
>     NIL. I
>     > wonder if its because 'tgs does not have +Idx in the relation
>     >
>     > (class +Item +Entity)
>     > (rel ttl (+IdxFold +String))
>     > (rel tgs (+List +Joint) itm (+Tag))
>     > (rel sts (+IdxFold +String))
>
>     Right, we cannot 'collect' using the 'tgs' relation, as it has no
>     index.
>
>
>     > Also,  (mapcar '((This) (: itm)) (collect 'nm '+Tag "BLUE"))
>     worked fine -
>     > now I see the beauty of "This" better. Btw, I had to get rid of
>     "T" in (collect
>     > 'nm '+Tag "BLUE" NIL T 'itm) to get it to work.
>
>     Ah, haha, sorry again :)
>
>     You can either
>
>        (collect 'nm '+Tag NIL T 'itm)
>
>     i.e. collect *all* tags (from minus infinte to plus infinite), or
>
>        (collect 'nm '+Tag "BLUE" "BLUE" 'itm)
>
>     to collect only the blue ones (from and till are "BLUE").
>
>     ☺/ A!ex
>
>     -- 
>     UNSUBSCRIBE: mailto:picolisp@software-lab.de
>     <mailto:picolisp@software-lab.de>?subject=Unsubscribe
>

Reply via email to