Karl Glazebrook wrote:
> Nathan Wiger wrote:
> > Yeah, and isn't it cool that Perl gives you easy access to using and
> > understanding such complex data structures:
> >
> > print @{ $cars->{$model} };
> >
> > That "junk" makes it easy to see that you're derefencing a hashref that
> > contains a key which is pointing to an array. How is this:
>
> it's a list of stuff - but a list of WHAT stuff? The @ is essentially
> useless.
It's a list of scalars.
> > print cars->model;
> >
> > any clearer? Nicer to look at? Maybe for some. Not for me, I like the
>
> yep. yep, and easier to teach.
See my sig. Try to make knowing easy even at the cost of making
learning hard.
> > former. Maybe it doesn't let you know exactly what you're getting, but
> > you're a lot closer. And this:
> >
> > print "Welcome back, $fullname, to $website!\n";
> >
> > is MUCH better than this:
> >
> > print "Welcome back " . fullname . " to " . website . "!\n";
>
> I agree. That's why I believe in retaining the $. The distinction between
> variable and non-variable is still useful.
And I think the distinction between a variable and a list of variables
is still useful as well.
> > Not true!! Only $scalars can hold objects. Now, @arrays and %hashes can
> > hold groups of objects, but only $scalars can hold objects.
>
> "Groups" is a meaningless concept. You have particular objects which store stuff.
> Is an image of a distant galaxy singular (one image) or plural (ten zillion pixels).
That depends. Do you want to think about a galaxy or a collection of
pixels?
> My argument, based on my practical experience, is that all the @% are essentially
> useless now.
Then your practical experience is radically different than mine.
> > To summarize, you should read RFC's 49, 73, 28, and the link to TomC's
> > email I sent you. These address the real problems, and not the symptoms.
>
> Yes. And I read TomC's stuff on those lines at least 6 years ago. Which
> was why I got annoyed.
What does that have to do with anything? What has changed in the last
six years that renders these concepts obsolete?
> The point remains - why treat hashes and arrays as special prefix types?
> It just confuses the language to have to use $ for one kind of collection
> and @ for another.
Why not let @ be used for other types of collections?
> ok we could use @ for everything - but @ implies 1D ness.
Why? (Answer: C<perl -we '$a[1,1] = 0'>)
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King