I know that it is probably (a few years) too late for a proposal like
this, that is highly "invasive" wrt Perl's semantic, but here it is 
anyway...

Cmd line switches are so useful and effective to quickly change the
behaviour of programs: IIRC tcl's syntax was inspired by them. But OTOH it 
is too strict in this sense (again IIRC) and Perl's one is much nicer IMHO 
(why else should I be programming in Perl?!?) however I wonder if in Perl6 
cmd line like switches could be introduced for functions and operators in 
a way not conflicting with "current" semantics and yielding yet MWTDI.

A wild guess suggests me that Perl6's ordered pairs may be a 
powerful/promising resource in this sense.

Specifically I'd like to have the possibility of doing something like 
this:

  rename -v => 1, $orig, $new;

and this should provide a nice default '--verbose' message a la:

  print "`$orig' => `$new'\n";

of course users should be allowed to fine tune the behaviour e.g. by means 
of something like (please excuse any explicit ignorance of actual Perl6 
proposed syntax):

  rename.SWITCHES{-v} = sub {
      my ($o, $n) = @_;
      print "renaming `$o' to `$n'\n";
  }


Michele
-- 
+++ wrote:
> Idiot.
top-poster
- Robin Chapman in sci.math, 
  "Re: This Week's Finds in Mathematical Physics (Week 204)"

Reply via email to