[EMAIL PROTECTED] (Mr. Nobody) writes:
We can't use « or ». Not only are they impossible to type on some editors,
but they're different in CP437 (the DOS charset), Latin1, and UTF8.
We've done this.
--
I've looked at the listing, and it's right!
-- Joel Halpern
Philip Hellyer wrote:
Damian's proposal didn't say anything about array params. If I understood
him correctly, then this should print FOO on standard out:
my $foo = FOO;
$foo ~ print;
Correct.
The opposite 'squiggly arrow' fiddles the indirect object, so perhaps this
would print
Jonathan Scott Duff suggested:
Oh, then we just need a syntax to split the streams. ... I know!
@list ~| grep /bad!/ ~ @throw ~| grep /good/ ~ @keep;
Unfortunately, that's already taken (it's the bitwise-OR-on-a-string operator).
Fortunately that doesn't matter, since no extra binary
frederic fabbro wrote:
I'm not even sure how that would parse, though that:
@keep ~ grep /good/ ~ @list ~ grep /bad!/ ~ @throw;
would go like:
( @keep ~ grep /good/ ~ @list ) ~ grep /bad!/ ~ @throw;
Correct, if ~ is indeed slightly higher precedence than ~
which is probably not
Rafael Garcia-Suarez asked:
Damian Conway [EMAIL PROTECTED] wrote:
There are in fact *two* types associated with any Perl variable
How does it work regarding inheritance and polymorphism ?
E.g. consider
my @a is Set of Apple;
my @b is Basket of Fruit;
with Apple isa Fruit, and Basket
Andy Wardley wrote:
I also think this is semantically fabulous but syntactically slightly
dubious. '~' reads 'match' in my book,
Really? We don't have any trouble in Perl 5 with an = character
being used in various unrelated operators:
== comparison
=assignment
~= match
In a message dated Thu, 9 Jan 2003, Damian Conway writes:
One *might* argue that ~ ought to be of higher precedence than ~
(i.e. that invocants ought to be bound ahead of other arguments).
If so, then:
$foo ~ print ~ $*STDERR
is really:
$foo ~ print $*STDERR:
is really:
Damian Conway wrote:
Really? We don't have any trouble in Perl 5 with an = character
being used in various unrelated operators:
== comparison
=assignment
~= match
s/~=/=~/
= comma
= less than or equal to
But these are all roughly related to the concept
Michael Lazzaro asked:
OK, next question. Is _THIS_ possible?
class FileBasedHash is Hash { ...stuff... };
my %data is FileBasedHash('/tmp/foo.txt');
Yes. Though we would need a syntax for specifying that string parameter for the
generic CFileBasedHash class. And, of course, a
Mr. Nobody wrote:
I don't like either of these operators. What's wrong with
@out = sort map {...} grep {...} @a
?
For a start, if these functions were to become (only) methods in Perl 6,
it would have to be:
@out = sort map grep @a: {...} : {...} :;
And even if we do have
On Wed, 8 Jan 2003 15:39:52 -0500, Dan Sugalski wrote:
At 7:29 PM -0700 1/7/03, John Williams wrote:
Perhaps you could explain how the $0 object will work in your mind.
A5 assert that $0 is a object, and it behaves as an array and a hash,
depending on how you subscript it. Typeglobs are gone,
On Thu, 9 Jan 2003, Peter Haworth wrote:
On Wed, 8 Jan 2003 15:39:52 -0500, Dan Sugalski wrote:
At 7:29 PM -0700 1/7/03, John Williams wrote:
Perhaps you could explain how the $0 object will work in your mind.
A5 assert that $0 is a object, and it behaves as an array and a hash,
On Thursday, January 9, 2003, at 05:36 AM, Damian Conway wrote:
Chris Dutton wrote:
@ages[*] = $today - %date_of_birth{@names}.values[*]
Well done. Thanks for working that out, Chris. And, in the process,
confirming my sense that vector ops are a better solution here.
;-)
Glad I could
HUGE chungs of stuff cut
my Set of Apple $a;
my Basket of Fruit $b;
and a generic assignment:
$c = $a;
$c = $b;
Now we can fill in your list (which is somewhat expanded):
AssignmentOK?Because...
==
I'm just suggesting the same for the ~ character:
~~ smart-match
~concatenate
~| stringy bitwise OR
~ append args
~ invocate
This is where I get lost. I see 4 different concepts being overloaded
onto '~'.
In the first it indicates 'match' just as it
Damian Conway writes:
Unary ~ would (by analogy to unary dot) append the current topic to the
argument list of its operand.
Thus, your examples become simply:
given @list {
~ grep /bad!/ ~ @throw;
~ grep /good/ ~ @keep;
}
And:
--- Damian Conway [EMAIL PROTECTED] wrote:
Mr. Nobody wrote:
I don't like either of these operators. What's wrong with
@out = sort map {...} grep {...} @a
?
For a start, if these functions were to become (only) methods in Perl 6,
it would have to be:
@out = sort
At 2:08 PM + 1/9/03, Peter Haworth wrote:
On Wed, 8 Jan 2003 15:39:52 -0500, Dan Sugalski wrote:
At 7:29 PM -0700 1/7/03, John Williams wrote:
Perhaps you could explain how the $0 object will work in your mind.
A5 assert that $0 is a object, and it behaves as an array and a hash,
Mr. Nobody [EMAIL PROTECTED] wrote:
--- Damian Conway [EMAIL PROTECTED] wrote:
@a ~ grep {...} ~ map {...} ~ sort ~ @out;
That's going to be just plain confusing. Arguments to functions are
supposed
to be on the right. And what's up with using them for assignment? That's
making
On Thu, Jan 09, 2003 at 11:01:51AM -0700, Thom Boyer wrote:
Mr. Nobody [EMAIL PROTECTED] wrote:
3) Do you care about readability at all? It seems to me that ~ and ~
have no use except making perl 6 uglier and more complicated than it already
is.
I think ~ and ~ look pretty nice. They read
--- Thom Boyer [EMAIL PROTECTED] wrote:
Mr. Nobody [EMAIL PROTECTED] wrote:
--- Damian Conway [EMAIL PROTECTED] wrote:
@a ~ grep {...} ~ map {...} ~ sort ~ @out;
That's going to be just plain confusing. Arguments to functions are
supposed
to be on the right. And what's up
--- Mr. Nobody [EMAIL PROTECTED] wrote:
--- Thom Boyer [EMAIL PROTECTED] wrote:
Mr. Nobody [EMAIL PROTECTED] wrote:
--- Damian Conway [EMAIL PROTECTED] wrote:
@a ~ grep {...} ~ map {...} ~ sort ~ @out;
That's going to be just plain confusing. Arguments to functions
are
Mr. Nobody:
# It's not letting you do anything that you couldn't do before
# with normal function calls and assignment.
We're writing a useful language, not a Turing machine.
# I see it as making a bad idea even worse. I've never liked
# having one thing doing multiple completely different and
On Wed, Jan 08, 2003 at 05:59:14PM +0800, Damian Conway wrote:
my Array @array := SpecialArray.new;
Should the value in @array act like an Array or a SpecialArray? Most
people would say SpecialArray, because a SpecialArray ISA Array.
Weell...*I'd* say that @array should act
Has there been any discussion of how to create code in Perl 6 that's there
under some conditions, but not there under others? I'm thinking of the
spiritual equivalent of #ifdef, only Perlish.
In Perl 5, there were many attempts to use such a feature for debugging and
assertions. What everyone
On Thursday, January 9, 2003, at 03:05 AM, Damian Conway wrote:
I don't know about *your* font, but in mine the ~ and ~ versions are
at least twice as readable as the | and | ones.
Just out of curiosity, how did you measure that? ;-)
David
--
David Wheeler
Date: Thu, 09 Jan 2003 19:55:20 -0500
From: John Siracusa [EMAIL PROTECTED]
Has there been any discussion of how to create code in Perl 6 that's there
under some conditions, but not there under others? I'm thinking of the
spiritual equivalent of #ifdef, only Perlish.
In Perl 5, there
On 1/9/03 9:01 PM, Luke Palmer wrote:
Well, I just do:
sub debug {
print STDERR shift, \n if DEBUG;
}
And hopefully (I don't know P5 internals so well) that optimizes to a
no-op so there's not even a function call there.
I don't know P5 internals so well either, but I'm guessing
On 1/9/03 10:10 PM, Michael G Schwern wrote:
I would assume it to be a compiler hint via subroutine attribute.
sub debug ($msg) is off {
print STDERR $msg;
}
some this subroutine is a no-op if a flag is set attribute.
Hm, not quite as convenient as setting a package global
On Thursday 09 January 2003 01:01 pm, Thom Boyer wrote:
If you read ~ and ~ as stuff this thingy into that doohicky, assignment
makes perfect sense. They are plumbing connectors: sometimes they connect
the water softener to the water heater (one device to another), and
sometimes they connect
30 matches
Mail list logo