ooc-lang / rock

:ocean: self-hosted ooc compiler that generates c99
http://ooc-lang.org/
MIT License
404 stars 40 forks source link

Left side of the nullco operator should not be evaluated twice. #937

Closed alexnask closed 9 years ago

alexnask commented 9 years ago

Instead, create a temporary variable, assign the value of the left side in a comma sequence right before evaluating the ternary expression.

Also, I think nullco rolls off the tongue nicely.

alexnask commented 9 years ago

This looks trivial enough to merge right away.
Hope I don't regret this ^^

fasterthanlime commented 9 years ago

@shamanas you're the boss - I'm not in a state to review/merge/anything right now, sorry!

alexnask commented 9 years ago

No problem, I am a collaborator after all.
I will review and make the open pull requests a bit less clunky myself, I won't merge anything if I don't find the solution to be elegant enough.