Alex,
> Thanks for sharing this!
>
Of course!
A small note about the places where you assign a value to 'ptr':
>
> (=: ptr
> (liblo~ffi ...
>
> This works, because 'ptr' is defined as a plain number property
>
> (rel ptr (+Number))
>
> without any entity/relation side effects. But if you make, for example,
> an index later
>
> (rel ptr (+Ref +Number))
>
> then it will break because the index will not be maintained when a value
> is assigned.
>
> So in general, you should use 'put>' to assign properties to entities:
>
> (put> This 'ptr
> (liblo~ffi ...
>
Good to know! I'll make that change, as I'm sure '+Ref' and it's cousins
will be helpful as I move beyond sending a single message to a single
server on the same machine :)
Another question about methods, while we're on the topic... For most of my
'dm's the first argument is implied. For example,
[dm message-add-int32> (N)
... ]
is expected to be called with the message (external symbol) followed by the
number to be added to the message. The message is then accessed by the '(:
ptr)' in the body. Is this the right way to do it, or should I make it more
explicit? Seemed to work as I was playing around with it, so I kept it,
even though I don't fully understand why it works.
Thanks!