At 08:38 -0400 8/4/06, John Siracusa wrote:
On 4/8/06 6:29 AM, Damian Conway wrote:
I'm not enamoured of the .# I must confess. Nor of the #. either.
Thank goodness...I was beginning to think it was only me!
For the record, I agree with both of you, and that your proposed
alternatives are
On 4/8/06 6:29 AM, Damian Conway wrote:
> I'm not enamoured of the .# I must confess. Nor of the #. either.
Thank goodness...I was beginning to think it was only me!
> Though, frankly, every one of the alternatives proposed so far is so ugly that
> I seriously doubt that anyone will actually want
Folks,
With Perl6, we have singleton methods as
$me.meta.add_method(me => sub{ ... });
But is there a way to, say, add methods within lexical scope?
Take URI on Perl 5. URI behaves both as an object
my $uri = URI->new("http://dev.perl.org/perl6/";);
print $uri->path; # "/perl6/"
But it als
Dan Kogai wrote:
~slurp $file;
Very clever. But still not good enough when it comes to autoboxing.
{ ~slurp }($*PROGRAM_NAME).print
and even
(~slurp $*PROGRAM_NAME).print
works as expected but since "~slurp $file" is really ~(slurp $file),
$*PROGRAM_NAME.~slurp.print
does not.
On Apr 08, 2006, at 19:34 , Dan Kogai wrote:
does not. The problem of ~stringify, ?boolify, and +numify is that
they are infix operators so it goes the opposite direction.
s/infix/prefix/
Sorry.
Dan the Perl6 Golfer on the Bunker
On Apr 08, 2006, at 18:45 , Damian Conway wrote:
Dan Kogai wrote:
With that understood, I would welcome if we have a version of slurp
() which unconditionally returns a scalar.
That'd be:
~slurp $file;
:-)
Very clever. But still not good enough when it comes to autoboxing.
Larry wrote:
I really prefer the form where .#() looks like a no-op method call,
and can provide the visual dot for a postfix extender. It also is
somewhat less likely to happen by accident the #., I think. And I
think the front-end shape of .# is more recognizable as different
from #, while #
Larry Wall schreef:
> before anyone else points it out to me
> I think the long-dot
> rule is built into the parser rather than falling out of the
> longest-token rule.
I think so too, but why then cling to the dot?
s:p5/[\][#][^\]*[#][\]// (does not match \#\ )
The backslash is no
Dan Kogai wrote:
With that understood, I would welcome if we have a version of slurp()
which unconditionally returns a scalar.
That'd be:
~slurp $file;
:-)
Damian
Folks,
This is a poetic quine (or quine-maker) in perl5.
open myself, $0 and print ;
The same thing in perl6 would be:
my $self = open $*PROGRAM_NAME; for =$self { say }
or
my $self = open $*PROGRAM_NAME; say for =$self;
or
my $self = slurp $*PROGRAM_NAME; print $self;
or even
10 matches
Mail list logo