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

History retention merge request #3

Merged
merged 2 commits into from
Jan 4, 2014
Merged

Conversation

blackhole89
Copy link

Hi,

I added some features of varying degrees of questionability, namely:

  • it now prints the type of every line by default;
  • it retains past lines unless they introduced errors (this might or might not be problematic as it stands, but makes something much closer to the usual REPL workflow possible);
  • in case of a line just binding a variable (let ... or fn ...), it echoes the name and value of what was bound and its type rather than the less-than-useful () : ().

All together, you can now do things like

irust> fn f(x:int) -> int { x+3 }
f = fn(int) -> int : fn(int) -> int
irust> f(5)
8 : int
irust> let mut a = 1
a = 1 : int
irust> a=4
() : ()
irust> f(a)
7 : int

I hope some of this is useful/usable! Unfortunately, I'm not a Ruby programmer, so the code might not be exactly idiomatic.

Yours,
Matvey

@tarcieri
Copy link
Owner

tarcieri commented Jan 4, 2014

Nice, thank you! I'll take care of "idiomatifying" it

tarcieri added a commit that referenced this pull request Jan 4, 2014
History retention merge request
@tarcieri tarcieri merged commit 73f2b31 into tarcieri:master Jan 4, 2014
@tarcieri
Copy link
Owner

tarcieri commented Jan 5, 2014

Cleaned up and released as irust 1.1.1. Thanks!

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

2 participants