Open bobzhang opened 4 years ago
@bobzhang This is a good improvement, nicely done!
I have a question that may be better converted to an issue in the BuckleScript repo. Would you consider changing the representation of lazy values to say something like "unrealized"
or "pending"
instead of "todo"
. I'm betting folks will be confused if they see "todo"
in their output (either code or console).
My reasoning for the above is that "todo"
generally represents things that need to be addressed in code, and it may make sense to generate another keyword.
@anmonteiro the problem with a longer string is it'll be repeated for every lazy value, which might bloat the app size depending on how much it's used
maybe true
/false
would be better? 🤔
@anmonteiro @TheSpyder good idea, I am going to rename it to {RE_LAZY_DONE : true|false}
@bobzhang cool, maybe later there can be a "minify" compiler mode that shrinks the key string to a single character :joy: something I'd like for some of my records-as-objects too :joy:
This is cool! Also I learned something, I didn’t know pattern match was an alternative to calling
Lazy.force
🤔