Closed lazyval closed 12 years ago
Sorry for the review delay (also for https://github.com/scalapuzzlers/scalapuzzlers.github.com/pull/17)! Been a crazy couple of weeks ;-)
I'll try to get round to this in the coming days...
Nice! I would only suggest a couple of small things:
Prints nothing Prints <lazy> since the value will not be evaluated Prints an empty line Prints 1
@demobox
Good with me....@nermin ?
@nermin suggests the following answers (in any order):
based on the fact that these are more likely to be encountered in the REPL than "print nothing" or "prints an empty line". What do you think?
Sorry about such long delay, I've been really busy for the past few days.
@demobox I like your answers, except the first one. Divide by zero will be thrown in any case (but then will be caught by catch block) , that's how the code is written. I think that you possibly mean unhandled exception, so we need to specify that little detail in order to not confuse the reader.
@nermin I've assumed that the one will likely will solve puzzler doing some crunching in REPL, that is why I've proposed <<lazy>>
as one of the possible answers.
@om-nom-nom I understand now the rationale behind
Thoughts?
@nermin "I understand now the rationale behind , and"...did Markdown swallow something between "behind" and "," there..? ;-)
Ah, yes, I wanted to say rationale behind <lazy>
@nermin How about this?
@om-nom-nom Those seem to me as best 4 options for this puzzler.
@demobox whoa, thanks a lot
I've added puzzler related to lazy value computation in case we get an exception during the first time we call this val. Hope you'll like it. Not sure I've written explanation in a clean English, since it is not my first and native language, correct me, please, if you've noted something bad (or even awful) with spelling.