Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last result local '__' #63

Merged
merged 1 commit into from
Oct 7, 2017
Merged

Last result local '__' #63

merged 1 commit into from
Oct 7, 2017

Conversation

veelenga
Copy link
Member

@veelenga veelenga commented Oct 2, 2017

Inspired by https://github.com/pry/pry/wiki/Special-Locals#Last_result

icr(0.23.1) > a = 42
 => 42
icr(0.23.1) > __
 => 42
icr(0.23.1) > __ + 1
 => 43
icr(0.23.1) > 1 + __
 => 44
icr(0.23.1) > __.to_s
 => "44"
icr(0.23.1) > __.to_i
 => 44
icr(0.23.1) > inc = -> { __ + 1 }
 => #<Proc(Int32):0x1002ea350>
icr(0.23.1) > inc.call
 => 45
...

cc @jwoertink

@veelenga veelenga mentioned this pull request Oct 2, 2017
@jwoertink
Copy link
Collaborator

Beautiful! I think it looks nice, and doesn’t feel awkward. Plus the change is pretty minimal. 👍

@veelenga
Copy link
Member Author

veelenga commented Oct 3, 2017

@greyblake @crystal-community WDYT?

@veelenga
Copy link
Member Author

veelenga commented Oct 6, 2017

Hey guys. Can I merge this?

@greyblake
Copy link
Member

I think yes.
Would someone mind adding a description of this feature to README?

veelenga added a commit that referenced this pull request Oct 7, 2017
veelenga added a commit that referenced this pull request Oct 7, 2017
@veelenga
Copy link
Member Author

veelenga commented Oct 7, 2017

@greyblake thanks. Added in #64

@veelenga veelenga merged commit 2c3946a into master Oct 7, 2017
@veelenga veelenga deleted the feature/__ branch October 7, 2017 17:21
veelenga added a commit that referenced this pull request Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants