bloom-lang / bud

Prototype Bud runtime (Bloom Under Development)
http://bloom-lang.net
Other
856 stars 59 forks source link

Issue #289. Disallow <= outside bloom blocks. #299

Closed aarondav closed 11 years ago

aarondav commented 11 years ago

When used on scratches/interfaces, <= will have no effect outside a bloom block. When used on tables, <= will place the tuples in, available in the next tick.

Disallowing <= loses us nothing that <+ doesn't provide, while also eliminating a user-facing corner case.

Note that inside_budinit was added, because meta_rewrite calls BudCollection <= during the rewrite phase. Otherwise, we just use inside_tick.

The error message looks like this: ../collections.rb:605:in <=' : illegal use of <= outside of bloom block (Bud::CompileError) from XactKVSProtocol.rb:103:in

'

neilconway commented 11 years ago

Thanks for the patch! A few suggested changes:

Otherwise no objections.

aarondav commented 11 years ago

I used the budinit thing because I wasn't sure if other people might be using <= similarly. If you're pretty sure that's the only place, or that similar cases would become obvious, I can go ahead and do that.

neilconway commented 11 years ago

Other places should be obvious, I'd think (such code will just produce an error).

aarondav commented 11 years ago

Removed budinit, changed meta_rewrite, updated 13 tests, added one test, and error mention now mentions <+. Of note, the changes to tests did make the notation more consistent -- the use of <= was just randomly interspersed between uses of <+.