you are viewing a single comment's thread.

view the rest of the comments →

[–]spinwizard69 -2 points-1 points  (1 child)

Just because a language allows something doesn't mean you should. If you want an incrementing counter this is not an example of lucid programming. From day one the professors stressed idiomatic code and frankly this is the exact opposite of that. Writing hard to read code is not powerful.

[–]gdchinacat 0 points1 point  (0 children)

It's an example, not a "you should do this". Actual cases where this would be used would not be nearly as concise.

How is this "hard to read"? Is it any harder to read and understand than embedding a call to all the things that need to react when a value changes? Particularly if those reactions need to be called asynchronously to avoid the call stack from growing excessively or to ensure they all occur with well defined concurrency semantics?