In reply to your message from the not too distant future: next Tuesday AD
Reply-to: [EMAIL PROTECTED]
Return-receipt-to: [EMAIL PROTECTED]
Organization: a) Discordia b) none c) what's that?
Content-Typo: gibberish, charset=ascii-art
Date: Tue, 22 Aug 2000 11:06:21 EDT
From: Jerrad Pierce belg4mit
Today around 11:06am, Jerrad Pierce hammered out this masterpiece:
: It will show that you are doing what you *want* to do, not letting
: automagic error-blind spoofery behind the curtains flummux up
: your life unnecessarily.
:
: Umm no.. for what I *want* to do is take the keys of the hash
Jerrad Pierce wrote:
In reply to your message from the not too distant future: next Tuesday AD
Reply-to: [EMAIL PROTECTED]
Return-receipt-to: [EMAIL PROTECTED]
Organization: a) Discordia b) none c) what's that?
Content-Typo: gibberish, charset=ascii-art
Date: Tue, 22 Aug 2000 11:06:21 EDT
But I do agree it would be nice if there were a way to simultaneously
construct and dereference an anonymous array or list, perhaps something
like
@( 1, 2, 3 )
%( foo = 1, bar = 2 )
which would be equivalent to
@{[ 1, 2, 3 ]}
%{{ foo = 1, bar = 2 }}
but with
Tom Christiansen wrote:
it's already there. One just works on the compiler to
be smarter on optimizing.
I suppose that's true. But why would
%( foo = 1, bar = 2 )
be "working harder" than
%{{ foo = 1, bar = 2 }}
??? It's few keystrokes and would be a less tricky
John Porter writes:
I suppose that's true. But why would
%( foo = 1, bar = 2 )
be "working harder" than
%{{ foo = 1, bar = 2 }}
??? It's few keystrokes and would be a less tricky concept
to remember.
It's a new syntax, not orthogonal to anything we already have. The
number
Nathan Torkington wrote:
John Porter writes:
I suppose that's true. But why would
%( foo = 1, bar = 2 )
be "working harder" than
%{{ foo = 1, bar = 2 }}
??? It's few keystrokes and would be a less tricky concept
to remember.
It's a new syntax, not orthogonal to anything
John Porter writes:
So? Perl's not like that. Perl is diagonal. And this is just
another corner being cut.
Cut away enough corners, and you have a black hole. Or something :-)
My point is that before you reach to invent new syntax, see if there's
a way to do what you want with the
Today around 3:01pm, John Porter hammered out this masterpiece:
: Nathan Torkington wrote:
: John Porter writes:
: I suppose that's true. But why would
: %( foo = 1, bar = 2 )
: be "working harder" than
: %{{ foo = 1, bar = 2 }}
: ??? It's few keystrokes and would be a less
my %hash = func();
print "$_\n" foreach keys %hash;
To work just like this:
print "$_\n" foreach keys func();
In my, 'pretending to just learn' mode, I don't understand. Perl will assign
the LIST to the hash in example one, but in example two, it croaks.
A LIST is not a HASH. Learn
As a user, I should be able to expect this:
I've decided I don't believe you, because despite having taught a
zillion people Perl, I have never *once* seen the misexpectation
and subsequent error that you're spending so much time complaining
about.
--tom
Today around 1:41pm, Tom Christiansen hammered out this masterpiece:
: my %hash = func();
: print "$_\n" foreach keys %hash;
:
: To work just like this:
:
: print "$_\n" foreach keys func();
:
: In my, 'pretending to just learn' mode, I don't understand. Perl will assign
: the LIST to
Today around 1:51pm, Tom Christiansen hammered out this masterpiece:
: As a user, I should be able to expect this:
:
: I've decided I don't believe you, because despite having taught a
: zillion people Perl,
Commendable. I value your expertise.
: I have never *once* seen the misexpectation
There is no documentation that states:
``keys() just doesn't work on lists and/or arrays, you must use this syntax to
force that to work:
@array = keys %{{@array}};
''
Or something like that.
keys is documented to take a hash. Likewise, push an array.
This all seems completely obvious.
Casey R. Tweten wrote:
Removing intermediate data structures is easy in Perl, but not this case,
Ceach, etc. must have data structures to work on. There's no "getting rid"
of them.
"I want find /usr to search the directory tree, but, um, I don't want to
actually *have* a directory
Casey R. Tweten wrote:
There is no documentation that states:
``keys() just doesn't work on lists and/or arrays,
Why should it bother saying that, when it already says keys() works on a HASH?
Or is there some confusion that a HASH might also be an ARRAY or a LIST?
--
John Porter
[to you only, as this thread is now distinctly off-topic for perl6-language]
Buddha Buck wrote:
@array1 = (1, 1, 3, 5, 8, 13);
%hash1 = ('foo', 34, 'bar', "not a number", 'baz', 4);
@array2 = %hash1;
%hash2 = @array1;
This works, and may lead to confusion because:
This is exactly
It doesn't help that Camel II's glossary defines "array" as "A named list
of values, each of which has a unique key to identify it. In a normal
array, the key is numeric... In a hash...the key is a string." and seems to
go to a lot of effort to deprecate "array" in favor of "list" (array
In reply to your message from the not too distant future: next Monday AD
Reply-to: [EMAIL PROTECTED]
Return-receipt-to: [EMAIL PROTECTED]
Organization: a) Discordia b) none c) what's that?
Content-Typo: gibberish, charset=ascii-art
Date: Mon, 21 Aug 2000 19:04:27 EDT
From: Jerrad Pierce belg4mit
19 matches
Mail list logo