Michael Lazzaro wrote:
Great -- then I have only one more question, I think. In the words of a
certain cartoon character, what's *this* button do?
my $b is $a;
Syntax error, I'd expect. Though the desired effect could probably be achieved
with the Cprop meta-property:
my $b is
Jonathan Scott Duff wrote:
will this:
my $a $b;
be illegal?
I certainly hope so!
Damian
Piers Cawley observed:
BTW, Cmy Foo $a is Foo is just sick!
(i.e. I'll *definitely* be using it ;-)
Surely anyone who does C my Array @foo , or C my Scalar $foo
will be using it, albeit indirectly.
Of course, but without the brain-twisting effect of the
repeated classname.
;-)
Damian
[EMAIL PROTECTED] (Michael Lazzaro) writes:
Great -- then I have only one more question, I think. In the words of
a certain cartoon character, what's *this* button do?
my $b is $a;
I think at this stage it's probably worth reminding everyone that not
every string of characters *needs* to
Michael Lazzaro [EMAIL PROTECTED] writes:
On Thursday, January 9, 2003, at 03:24 AM, Damian Conway wrote:
Michael Lazzaro asked:
class FileBasedHash is Hash { ...stuff... };
my %data is FileBasedHash('/tmp/foo.txt');
Yes.
my $path = '/tmp/foo.txt';
my %data is
Damian Conway [EMAIL PROTECTED] writes:
Michael Lazzaro wrote:
Which, in turn, implies that the lines:
my Foo $a; # (1)
my $a is Foo; # (2)
my Foo $a is Foo; # (3)
are all subtly different. (2) and (3) (auto)instantiate a Foo, but
(1) does not.
Correct. Though the
On Tuesday, January 14, 2003, at 02:24 AM, Piers Cawley wrote:
Michael Lazzaro [EMAIL PROTECTED] writes:
Great -- then I have only one more question, I think. In the words of
a certain cartoon character, what's *this* button do?
my $b is $a;
Compile time error. 'is' is a compile time
At 9:23 AM -0800 1/14/03, Michael Lazzaro wrote:
On Tuesday, January 14, 2003, at 02:24 AM, Piers Cawley wrote:
Michael Lazzaro [EMAIL PROTECTED] writes:
Great -- then I have only one more question, I think. In the words of
a certain cartoon character, what's *this* button do?
my $b is
On Thursday, January 9, 2003, at 03:24 AM, Damian Conway wrote:
Michael Lazzaro asked:
class FileBasedHash is Hash { ...stuff... };
my %data is FileBasedHash('/tmp/foo.txt');
Yes.
my $path = '/tmp/foo.txt';
my %data is FileBasedHash($path);
Indeed
Great -- then I have only
On Fri, Jan 10, 2003 at 10:28:49AM -0800, Michael Lazzaro wrote:
Great -- then I have only one more question, I think. In the words of
a certain cartoon character, what's *this* button do?
my $b is $a;
And no matter what that button does, will this:
my $a $b;
be illegal?
From: Thom Boyer [EMAIL PROTECTED]
Date: Fri, 10 Jan 2003 13:57:26 -0700
From: Michael Lazzaro [mailto:[EMAIL PROTECTED]]
But I don't know if these two
lines would really have the same result, ...
$a = MyScalar;
$a = 'MyScalar';
Hrmm. Didn't Larry decree that there are
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
Michael Lazzaro wrote:
my int @a;
my @a returns int;
my @a is Array of int;
my @a is Array returns int;
my int @a is Array;
Those lines are all absolutely synonymous, and all declare an array of
integers, right?
Right. (This week, at least ;-)
Likewise, Arrays have
Jonathan Scott Duff wrote:
On Tue, Jan 07, 2003 at 10:04:09AM -0800, Michael Lazzaro wrote:
Which, in turn, implies that the lines:
my Foo $a; # (1)
my $a is Foo; # (2)
my Foo $a is Foo; # (3)
are all subtly different. (2) and (3) (auto)instantiate a Foo, but (1)
From: Deborah Ariel Pickett [EMAIL PROTECTED]
Date: Wed, 8 Jan 2003 09:42:18 +1100 (EST)
[...] But everybody has to learn Perl once.
I agree with you entirely :)
Luke
On Wednesday, January 8, 2003, at 02:17 AM, Damian Conway wrote:
Jonathan Scott Duff wrote:
On Tue, Jan 07, 2003 at 10:04:09AM -0800, Michael Lazzaro wrote:
Which, in turn, implies that the lines:
my Foo $a; # (1)
my $a is Foo; # (2)
my Foo $a is Foo; # (3)
are all
On Wednesday, January 8, 2003, at 02:13 AM, Damian Conway wrote:
Michael Lazzaro wrote:
The remaining big question, then, is whether you can truly subclass
Array to achieve Ctie-like behavior:
class MyArray is Array { ... };
my @a is MyArray;
Oh yes, I would certainly expect that this
On Wednesday, January 8, 2003, at 01:32 PM, Michael Lazzaro wrote:
On Wednesday, January 8, 2003, at 02:13 AM, Damian Conway wrote:
Michael Lazzaro wrote:
The remaining big question, then, is whether you can truly subclass
Array to achieve Ctie-like behavior:
class MyArray is Array { ...
On Wednesday, January 8, 2003, at 10:39 AM, Chris Dutton wrote:
I would ask, if it's possible to inherit from Array or Hash, is it
possible to inherit from one which has a constrained storage type?
my WeirdHash is int Hash { ... }
Yes, I think that was tentatively confirmed a while back.
I think this may be another case of it depends on what the word
'object' means, e.g. we're talking past each other. I hope.
Let's operate from the assumption -- or somebody please CORRECT ME IF
I'M WRONG -- that the following syntax is valid:
my int @a;
my @a returns int;
my @a is
On Tue, Jan 07, 2003 at 10:04:09AM -0800, Michael Lazzaro wrote:
I think this may be another case of it depends on what the word
'object' means, e.g. we're talking past each other. I hope.
Let's operate from the assumption -- or somebody please CORRECT ME IF
I'M WRONG -- that the
--- Michael Lazzaro [EMAIL PROTECTED] wrote:
Arrays have methods:
my int @a = (1..100);
print @a.length; # prints 100
my @b = @a.grep { $_ 50 }; # gets 51..100
.length is unneeded, since an array gives its length in numeric context, so
you can just say +@a. grep
On 2003-01-07 at 11:31:13, Mr. Nobody wrote:
.length is unneeded, since an array gives its length in numeric context, so
you can just say +@a.
Unneeded, but harmless.
grep shouldn't be an array method either, it should be
like the perl5 grep, as it is often used on lists, grep /foo/, keys %h
On 2003-01-07 at 11:31:13, Mr. Nobody wrote:
.length is unneeded, since an array gives its length in numeric context, so
you can just say +@a.
Unneeded, but harmless.
Getting off topic here (a bit), but I think it's a Mistake to have
.length mean different things on an array [Number of
On Tuesday, January 7, 2003, at 02:05 PM, Deborah Ariel Pickett wrote:
On 2003-01-07 at 11:31:13, Mr. Nobody wrote:
.length is unneeded, since an array gives its length in numeric
context, so
you can just say +@a.
Unneeded, but harmless.
Getting off topic here (a bit), but I think it's a
Mark J. Reed [EMAIL PROTECTED] writes:
On 2003-01-07 at 11:31:13, Mr. Nobody wrote:
.length is unneeded, since an array gives its length in numeric context, so
you can just say +@a.
Unneeded, but harmless.
grep shouldn't be an array method either, it should be
like the perl5 grep, as it
Perhaps .size for number-of-elements and .length for length-of-string
would work?
sarcasm
This would just cause them to Think About Things A Different But
Equally Wrong Way: as assembly language objects whose SIZE in bytes is
the determining component of their existence.
/sarcasm
I am
27 matches
Mail list logo