Open owen2345 opened 3 years ago
Well this is interesting! I'll come back to review a bit later, but my first question is what is the difference between _p
and __
(two underscores we currently use)?
Well difference between _p
and __
is that __
can not be used as a variable in the next command, against _p
which can be used as a normal variable like:
puts "previous value: #{_p}"
Btw: I tried to replace _p
into __
but unfortunately crystal does not accept as a valid variable name, either _
;
__ can not be used as a variable in the next command
I'm not sure that I follow exactly. I know this works in Crystal
__ = 1
__ += 1
puts __
Here's the PR where it was added in originally https://github.com/crystal-community/icr/pull/63
I just want to make sure that if we're making this change, it's not a 1 to 1 of what we have now for the sake of "a better name" or something along those lines. I'd rather not have 2 ways to do this, so if we're going to add in _p
, then we should remove __
with an explanation as to why _p
is a better solution. Hope that makes sense.
@jwoertink you were right! Sorry my mistake. I was too tired yesterday then I could not test it very well.
No worries! I just want to make sure we're getting this right. Thanks for contributing ❤️
Features
__
or__previous_result
TODO:
Samples:
Status: In progress