Hi Henrik,

> (rel feeds    (+List +Ref +Link) NIL (+Feed))
> ...
> (put> Usr 'feeds Feed)
> ...
> (dm addFeed> (F)
>    (let Feeds (; This feeds)
>       (push1 'Feeds F)
>       (put!> This 'feeds Feeds)))
> ...
> The first example of assignment seems to imply that put> will automatically
> take care of adding a new feed to the list, ie. not replacing the whole list

Correct. The 'put>' methods of the relation classes which handle
compound structures (+List and +Bag) behave somewhat intelligently if
they get (and detect) partial data. The reason was partially for the
GUI, I think, where a +Bag maps to a +Chart and must be able to accept
incomplete data.

So the 'addFeed>' method above is not really necessary. You might even
say it is wrong, as it gets the old list with (; This feeds), modifies
it, and then calls 'put!>'. Then the whole operation is non-atomic, and
another process could modify the list meanwhile.


> (dm removeFeed> (F)
>    (put!> This 'feeds (delete F (; This feeds))))

This situation is similar. Note that you can use 'del!>' here:

   (del!> This 'feeds F)

(However, this is not available for +Bag)

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
  • Ref Link List Henrik Sarvell
    • Re: Ref Link List Alexander Burger

Reply via email to