4

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.

hyper-neutrino
  • 5,272
  • 2
  • 29
  • 50
  • 3
    You should consider the James answer. It all depends what exactly are you trying to achieve. It would be nice to know the details. If you really want to play with it you can see my answer - https://stackoverflow.com/questions/51363155/is-it-possible-to-write-shell-command-within-pharo-smalltalk/51375906#51375906 – tukan Dec 12 '19 at 09:28
  • 2
    Have a look here as well: https://stackoverflow.com/q/53638692/383568 – JayK Dec 12 '19 at 20:52

1 Answers1

7

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.

James Foster
  • 2,070
  • 10
  • 15