On Thu, 24 Jun 2004, Luke Palmer wrote:
> > defaults". For example, using Perl5 syntax, here's what I mean:
^^
^^
[snip]
> > perl -e 'unlink <*.txt> :v'
>
> Well it's certainly not going to be that, since
Michele Dondi writes:
> On Tue, 22 Jun 2004, Juerd wrote:
>
> > > rename -v => 1, $orig, $new;
> [snip]
> > I think just using named arguments would be better and much easier.
> >
> > sub rename ($old, $new, +$verbose) {
> > say "Renaming '$old' to '$new'" if $verbose;
>
>
> On Tue, 22 Ju
On Tue, Jun 22, 2004 at 11:50:03AM -0600, Luke Palmer wrote:
: That one doesn't work. Named arguments have to come at the end of the
: parameter list (just before the "data list", if there is one). This is
: a decision I'm gradually beginning to disagree with, because of:
:
: sub repeat (&co
On Tue, 22 Jun 2004, Juerd wrote:
> > rename -v => 1, $orig, $new;
[snip]
> I think just using named arguments would be better and much easier.
>
> sub rename ($old, $new, +$verbose) {
> say "Renaming '$old' to '$new'" if $verbose;
On Tue, 22 Jun 2004, Brent 'Dax' Royal-Gordon wrote:
> I
Luke Palmer skribis 2004-06-22 16:32 (-0600):
> &*rename.wrap -> $orig, $new, *%opt {
> say "Renaming '$orig' to '$new'" if %opt{'verbose' | 'v'};
> call;
> }
Would it be possible to just add a named argument, without repeating any
part of the existing signature? Like:
Michele Dondi writes:
> On Tue, 22 Jun 2004, Brent 'Dax' Royal-Gordon wrote:
>
> > > rename -v => 1, $orig, $new;
> >
> > It's already being done:
> >
> > rename $orig, $new :verbose;
> >
> > sub rename($orig, $new, +$verbose) {
> > say "Renaming `$orig' to `$new'" if $verb
On Tue, 22 Jun 2004, Brent 'Dax' Royal-Gordon wrote:
> > rename -v => 1, $orig, $new;
>
> It's already being done:
>
> rename $orig, $new :verbose;
>
> sub rename($orig, $new, +$verbose) {
> say "Renaming `$orig' to `$new'" if $verbose;
> ...
> }
I'm not sure
On Tue, 22 Jun 2004, Juerd wrote:
> Michele Dondi skribis 2004-06-22 18:24 (+0200):
> > rename -v => 1, $orig, $new;
>
> Any specific reason for the minus there? Perl's not a shell (yet).
Because one may want to restrict the number of pairs to be interpreted as
"cmd line" switches, I'm not ev
Juerd writes:
> Michele Dondi skribis 2004-06-22 18:24 (+0200):
> > rename -v => 1, $orig, $new;
>
> Any specific reason for the minus there? Perl's not a shell (yet).
>
> > rename.SWITCHES{-v} = sub {
> > my ($o, $n) = @_;
> > print "renaming `$o' to `$n'\n";
> > }
>
> I think
Michele Dondi wrote:
Specifically I'd like to have the possibility of doing something like
this:
rename -v => 1, $orig, $new;
It's already being done:
rename $orig, $new :verbose;
sub rename($orig, $new, +$verbose) {
say "Renaming `$orig' to `$new'" if $verbose;
...
Michele Dondi skribis 2004-06-22 18:24 (+0200):
> rename -v => 1, $orig, $new;
Any specific reason for the minus there? Perl's not a shell (yet).
> rename.SWITCHES{-v} = sub {
> my ($o, $n) = @_;
> print "renaming `$o' to `$n'\n";
> }
I think just using named arguments would be
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 to
12 matches
Mail list logo