I’ve seen a great idea in pike (not a big one, but helps beginners…)
If you start the language without any file, and input is terminal, the
interactive system should start.
Any comments?
This is quite common (see e.g. hugs).
Ruby also reads from stdin if started without a file, this is of
course not too helpful for a beginner, but allows for using it as a pipe.
I think this is the optimal way a scripting language should behave.
Ruby also reads from stdin if started without a file, this is of
course not too helpful for a beginner, but allows for using it as a pipe.
I think this is the optimal way a scripting language should behave.
It could actually do both. If stdin is a tty then it could give an
interactive session, otherwise fall back to the old behavior.
I think there are some examples of programs doing this, but I can’t
think of one right now.
Ruby also reads from stdin if started without a file, this is of
course not too helpful for a beginner, but allows for using it as a pipe.
I think this is the optimal way a scripting language should behave.
lizzy:~% python
Python 2.2.1 (#1, Apr 20 2002, 10:26:30)
[GCC 2.95.3 20010315 (release)] on freebsd5
Type “help”, “copyright”, “credits” or “license” for more information.
How about
lizzy:~% ruby
ruby(main):001:0>
?
···
On Fri, Oct 04, 2002 at 11:48:02PM +0900, Christian Szegedy wrote:
–
Jos Backus / /// Sunnyvale, CA
_/ _/ _/ / ///
_/ _/ _/ /
jos at catnook.com// /// require ‘std/disclaimer’
Ruby also reads from stdin if started without a file, this is of
course not too helpful for a beginner, but allows for using it as a pipe.
I think this is the optimal way a scripting language should behave.
It could actually do both. If stdin is a tty then it could give an
interactive session, otherwise fall back to the old behavior.
I think there are some examples of programs doing this, but I can’t
think of one right now.
lizzy:~% python
Python 2.2.1 (#1, Apr 20 2002, 10:26:30)
[GCC 2.95.3 20010315 (release)] on freebsd5
Type “help”, “copyright”, “credits” or “license” for more information.
How about
lizzy:~% ruby
ruby(main):001:0>
?
% irb
Reading config file… done.
ruby-1.7.3 on i586-pc-linux with irb 0.9(02/07/03)
Type ‘help’ for more information.