Perl has a general principle that, in the absence of any indication
otherwise, it should use a sensible default. This default generally
matches the most common use of the feature by new programmers. This
principle is reflected in Perl 6's design in many ways--$_, sort's
default behavior, the @_ list, etc.
I think that Perl 6 should apply that to the entire program. If the
whole program consists of an empty string, it should substitute in a
sensible default program.
I have done extensive research on the Internet and printed Perl books,
and have concluded that the single most common Perl program is the
following:
print "Hello world!\n";
Therefore, I recommend that, when given an empty program or -e string,
Perl 6 should print "Hello world!", emit a newline, and exit. I believe
that this feature would be fairly trivial to implement.
On the other hand, the current behavior may be somewhat entrenched, and
might break our promise to assume that code is Perl 5 until we see a
different indication. As an alternative, perhaps the -H command-line
switch could be used to use a "hello world" program.
--
Brent "Dax" Royal-Gordon <br...@brentdax.com>
Perl and Parrot hacker
Oceania has always been at war with Eastasia.
I think we need to consider all of the implications here: "Hello
World" is very english centric, so I would assume that Perl 6 would
need investigate the locale and change the text to "Monde, Allo!" if
you're using a French locale, "Hallo, Welt!" for German locale, and
"1 april!" for Dutch. ;-)
Liz
This makes perfect sense.
> I have done extensive research on the Internet and printed Perl
> books, and have concluded that the single most common Perl program
> is the following:
>
> print "Hello world!\n";
In P6, that would be:
say "Hello, world!";
> Therefore, I recommend that, when given an empty program or -e
> string, Perl 6 should print "Hello world!", emit a newline, and
> exit. I believe that this feature would be fairly trivial to
> implement.
I cannot agree with this.
In fact, if someone types "perl" on the command line without any
arguments, it seems obvious to me that they are intending to begin
development of a script.
As such, I think that we should refocus the parrot team's priority.
Instead of wasting valuable coding time winning the Parrathon, it would
be better to provide a functional elisp compiler targeted at the parrot
VM. This way, a naked invocation of "perl" would bring up a script
development system (emacs, ported to parrot: pmacs?) for further work.
Since the emacs codebase is already ported to many platforms, it should
be trivial to add this to the core perl distribution. Perhaps Simon
would agree to lead this effort?
> Brent "Dax" Royal-Gordon <br...@brentdax.com>
> Perl and Parrot hacker
Cheers,
=Austin
I would laugh, but http://search.cpan.org/~jtobey/Emacs-EPL-0.7/
--
On our campus the UNIX system has proved to be not only an effective software
tool, but an agent of technical and social change within the University.
- John Lions (U. of NSW)
> -----Original Message-----
> From: si...@alibi.simon-cozens.org
>
> austin_...@yahoo.com (Austin Hastings) writes:
> > Since the emacs codebase is already ported to many platforms, it should
> > be trivial to add this to the core perl distribution. Perhaps Simon
> > would agree to lead this effort?
>
> I would laugh, but http://search.cpan.org/~jtobey/Emacs-EPL-0.7/
!!
R.
--
Richard Nuttall
Nuttall Consulting
01353 649878
www.nuttall.uk.net