Piers Cawley observed:
BTW, C 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
Jonathan Scott Duff wrote:
> will this:
my $a $b;
be illegal?
I certainly hope so!
Damian
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 C meta-property:
my $b is prop($a);
D
[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*
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 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 pr
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.
>
> Corr
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
Luke Palmer wrote:
> I would imagine that would only work if $a was known at compile time:
I think we could do it at runtime too. You could conceivably use
runtime resolution to, for example, choose from between several
different caching behaviors to be passed to a complex routine:
sub get_c
> 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 decr
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 no bare words, but that a class
name will evaluate to the string representing th
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?
-
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 one
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 C class. And, of course, a mechanism for constru
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. But
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 C-like behavior:
class MyArray is Array { ... };
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 C-like behavior:
class MyArray is Array { ... };
my @a is MyArray;
Oh yes, I would certainly expect that this has t
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
> 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
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)
doe
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 methods
--- Austin Hastings <[EMAIL PROTECTED]> wrote:
>
> --- Deborah Ariel Pickett <[EMAIL PROTECTED]> wrote:
> > > Seriously, if they're smart enough to run a text editor, I think
> > it's
> > > safe to say that they can handle the conceptual difference
> between
> > the
> > > "length" (mins:secs) of
--- Deborah Ariel Pickett <[EMAIL PROTECTED]> wrote:
> > Seriously, if they're smart enough to run a text editor, I think
> it's
> > safe to say that they can handle the conceptual difference between
> the
> > "length" (mins:secs) of a video, and the "length" (feet:inches) of
> the
> > mag-tape th
> > Perhaps .size for number-of-elements and .length for length-of-string
> > would work?
>
> 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.
>
I am happy to
--- Deborah Ariel Pickett <[EMAIL PROTECTED]> wrote:
> Getting off topic here (a bit), but I think it's a Mistake to have
> .length mean different things on an array ["Number of elements"] and
> a (string) scalar ["number of characters"].
> While there will never be any confusion on the part o
"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
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 Mi
> 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
On Tuesday, January 7, 2003, at 11:26 AM, Jonathan Scott Duff wrote:
On Tue, Jan 07, 2003 at 10:04:09AM -0800, Michael Lazzaro wrote:
Let's operate from the assumption -- or somebody please CORRECT ME IF
I'M WRONG -- that the following syntax is valid:
my int @a;# 1
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/, key
--- 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
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 fo
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 A
33 matches
Mail list logo