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

[CLOSED] Implementation of raw_input() #33

Closed
alanjds opened this issue Aug 21, 2018 · 12 comments
Closed

[CLOSED] Implementation of raw_input() #33

alanjds opened this issue Aug 21, 2018 · 12 comments

Comments

@alanjds
Copy link

alanjds commented Aug 21, 2018

I implemented a simplified version of raw_input().

Please review on focusing these.
First, It might be not 100% compatible with CPython and pypy's raw_input().
and also need more implementation to handle error cases.

Second, I need some guide for writing unit test codes to check it is well working for raw_input().
I don't know how to test user's input from keyboard.

Third, prompt printing is slower when running with go run *.go so if you have solutions then please give me a feedback.

Related PR= google#247

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by corona10
Sunday Feb 05, 2017 at 00:00 GMT


@trotterdylan Thank you for great and awesome review. I will try to fix it.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by corona10
Monday Feb 06, 2017 at 03:59 GMT


@trotterdylan Updated! I fixed codes as you commented. Actually, about using grumpy.File object is not 100% same as you intended. I found the simpler way.
And I add unit test code, but it should be improvement later time. I wish other guys could improve this unit test to check user's input and function's output. Unfortunately, In now time, this is out of my ability.

PTAL

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by corona10
Tuesday Feb 07, 2017 at 04:07 GMT


@trotterdylan A lot of stuff!! I will do it as your comment. Thanks

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by corona10
Thursday Feb 09, 2017 at 22:47 GMT


@trotterdylan Updated!! Please take a look.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by corona10
Monday Feb 13, 2017 at 20:36 GMT


@trotterdylan Updated. PTAL

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by corona10
Tuesday Feb 14, 2017 at 07:53 GMT


@trotterdylan Updated.

p.s Can I get good materials to know when to use defer? I'm just using it as finally statement.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by trotterdylan
Tuesday Feb 14, 2017 at 20:47 GMT


@corona10 re: defer: It can be used like finally. But, like finally, it's only really useful if there are multiple possible paths for exiting the function or an exception (panic in Go) is raised. In this case, a panic is a fatal error so it doesn't really matter if we close things. The only time it's really important to run some code in the case of panic is if the panic may be handled somewhere (for the most part in the Grumpy code, we assume panic is fatal) or if you need to release some resource even in the event of a panic. Sometimes mutex falls into this category because it can otherwise cause a deadlock if not released. It's also good to guarantee that temp files are cleaned up. But otherwise, the possibility of panic is not usually a good reason to defer.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by corona10
Thursday Feb 16, 2017 at 01:48 GMT


@trotterdylan Thank you for review and great guide! I updated it and please take a look. Thanks to you, I learned about how Go works.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by corona10
Friday Feb 17, 2017 at 22:18 GMT


@trotterdylan Updated!! PTAL

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by corona10
Sunday Feb 19, 2017 at 00:44 GMT


@trotterdylan Thank you for reviewing long days :-)

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by pombredanne
Thursday Mar 02, 2017 at 10:42 GMT


@corona10 very nice :)

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Closing as this was imported by mistake. Already closed on google#233

@alanjds alanjds closed this as completed Aug 21, 2018
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

No branches or pull requests

1 participant