Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard Input in Smalltalk (Pharo) on Windows

I'm currently trying to learn the "most elegant and powerful" programming language since I'll need to be using it in about two months. However, I've been searching for an entire half-hour, and I have one simple request.

How do you read standard input with Pharo 7.0 Smalltalk on Windows? The solution I found here only works on Linux via using /dev/stdin as a file.

like image 416
hyper-neutrino Avatar asked Mar 03 '23 01:03

hyper-neutrino


1 Answers

Getting to standard input from a GUI application on Windows is not trivial (see https://social.msdn.microsoft.com/Forums/vstudio/en-US/799cc2b6-309e-4758-8c3b-7c602bbfb736/in-a-gui-program-where-is-stdout?forum=vcgeneral) and few GUI applications support it.

Why do you want to do this? Is it so you can transfer what you've learned from C/C++/C#/Java/Python and other such console-based environments? If so, I suggest you change your approach. Instead of trying to transfer your C tutorials to Smalltalk, I suggest that you learn Pharo using https://mooc.pharo.org. If you want to look at user input in a GUI context, take a look at the UIManager.

On the other hand, if you must write a console-based application, see CommandLineUIManager.

like image 105
James Foster Avatar answered Mar 05 '23 14:03

James Foster