Closed jhellerstein closed 11 years ago
<=
in that context is essentially be used like set-wise <<
. I agree it makes me a bit uneasy, although it isn't clear to me that disallowing it would be the right fix.
Actually, it seems reasonable to interpret BudCollection#<<
as the itemwise version of <+
, or forbid it altogether.
Meh, I suppose -- invoking logical operators outside of logic-land seems basically bogus to me; whether you interpret <<
as happening at "now" or "next" seems like 6 of one and a half-dozen of the other, IMHO. Interacting with Bloom collections from Ruby code (e.g., sync_do
or bootstrap
) is certainly useful, though.
I hear what you say about logical operators "outside of logic land" -- i.e. between ticks. I feel that <+ is well defined between ticks, whereas the other ops are not. Similarly the only reasonable definition of bc << i
is bc <+ [i]
-- it installs a logical definition into the program beginning at the next tick (much like sending a message, but without non-determinism in time of receipt).
Yeah, I can buy that. One concern is that this definition of << ("install a new fact @next") is not consistent with the normal meaning of << in Ruby ("append to an array, implicitly now").
The interpretation of <= has changed in the new runtime: it is now "add to delta", not "merge directly into storage". This is exactly the interpretation within a bloom block as well, under semi-naive evaluation.
Additionally, since all elements in delta are processed in the next iteration (if it is already inside a tick, or in the next tick), <= has the same interpretation and effect as <+ outside a tick: "add to a list of tuples to be processed, and process them at the next tick). '<+' moves stuff from pending to delta, in preparation for processing in the upcoming iteration. This is why we can use <= and <+ interchangeably in sync_do blocks.
<< should be removed, or confined only to bootstrap blocks.
Per #289, this should be resolved.
It seems semantically odd to allow <= to be used "between" or "before" ticks -- under what concept of "now" is that accumulation happening?
This relates to interfaces like
sync_do
andbootstrap
blocks.