Why use Perl when we've got Python?!
abigail at delanet.com
Sun Aug 15 12:04:09 CEST 1999
John Stevens (jstevens at bamboo.verinet.com) wrote on MMCLXXIV September
MCMXCIII in <URL:news:slrn7rb0uh.cf9.jstevens at bamboo.verinet.com>:
() On 14 Aug 1999 03:36:23 GMT, Sam Holden <sholden at pgrad.cs.usyd.edu.au> wrote:
() >On Sat, 14 Aug 1999 03:08:33 GMT,
() > John Stevens <jstevens at bamboo.verinet.com> wrote:
() >>On 14 Aug 1999 02:32:12 GMT, Sam Holden <sholden at pgrad.cs.usyd.edu.au> wrote:
() >>>On 13 Aug 1999 20:04:03 -0700,
() > John W. Stevens <jstevens at basho.fc.hp.com> wrote:
() >>>>Perl doesn't have lists. Python doesn't have built-in arrays.
() >>>You should learn some perl you now..
() >>>@array = (1,10,20,30);
() >>>$from_list = (1,10,20,30);
() >>>$from_array = @array;
() >>>print "$from_list\n$from_array\n";
() >>>Will output :
() >>The @ prefix denotes an array. You, yourself, should learn
() >>Perl. Calling an array a list, doesn't make it one.
() >Can you read?
() >Can you see a @ in the following line of code :
() >$from_list = (1,10,20,30);
() Your example included:
() @array = (1,10,20,30);
() $from_list = (1,10,20,30);
() $from_array = @array;
() print "$from_list\n$from_array\n";
() The line you specify does not contain a list, it contains a
A tuple? In Perl? Hmmm. Let's see, what does the manual say about
$ cd /opt/perl/lib/5.00503/pod
$ grep tuple *.pod
Strange. You must be the only person believing that Perl has tuples!
Of course, you can randomly relable everything, but then you're just
like a 5 year old.
() >No you can't. Is there an array in that line of code?
() No, and that isn't a list, even if you call it one. It is a tuple.
Repeat after me: Perl does not have tuples.
() >No. Is there a list
() >in that line of code?
() No, it's a tuple, not a list.
Let me repeat that again: Perl does not have tuples.
() No. Calling it a list, doesn't make it a list.
You must mean: "Calling it a tuple, doesn't make it a tuple."
It's a list. It has always been a list and it shall always be
() To be able to perform operations on the above, you'd have to
() assign the values of the tuple to an array.
You're so boring. There are no tuples in Perl.
() In which case you'd be performing array operations, not list
() >>Not built in, it doesn't, unless you define array and list as being
() >>different words for exactly the same type/class.
() >I don't think you can get more built in then perl lists.
() You get tuples in Perl. The book calls then lists, but you cannot
() perform any of the standard, defined list operations on a Perl
() All "list" operations are performed by shoving "lists" into
() Go ahead, show me a variable that contains a list. In your
As Sam said, there are no variables containing a list.
() $from_list = (1,10,20,30);
() $from_list isn't a list.
() >Again I repeat, here is a perl list : ('a', 'b', 'c') or qw(a b c)
() Again, you are wrong. The construct ('a', 'b', 'c') is a tuple.
() Perl'ers may call it a list, but how do you perform a an insert
() on the above?
Perlers call it a list. It's Perl code. Perl predates Python. Perlers
outnumber Pythoners. Hence, it's a list. No matter how much you whine.
List. List. List.
And of course you don't perform an insert on a list, for the same reason
you don't increase the number 5.
() You don't. You copy the contents of your tuple into an array,
() then perform array operations on that array.
There are no tuples in Perl.
() >>I know Perl. You need to learn Python.
() >Did I mention a single bit of python syntax in my post? No.
() So what? I can still make a comment. And if you had been
() paying attention, you would have realized the context of this
You should pet your cat more often.
() More specifically, had you studied Python, it would have been
() clear that what Perl calls a list is more properly refered to
() as a tuple.
Had you know a little bit of Perl, you would have known what a list was.
() If @ary were a list, it would be illegal.
Sure. And if @ary were a horse, it couldn't bark. What's your point?
@ary is an array. Not a list.
() >It is just
() >the special case of :
() Stop. You are talking about arrays, not lists. I repeat, if
() @ary were a list, the above operation would be illegal.
I repeat, if @ary were a horse, it couldn't bark. Your premise is
silly, and totally beside the point. @ary is an array. What it
can or cannot do if it were something else is irrelevant.
() >It is an array. Thus it has a @.
() Yes. It is an array, not a list. Though to be perfectly anal,
() it might be best to refer to that as a vector. . . ;->
It's the 5 year old again, making his own lables for everything.
() >>Really? What is the prefix character that denotes a list?
() >You can't have a list in a variable.
() Correct. So, Perl does not have lists, it has tuples.
Wrong. Perl does not have tuples, it has lists.
() >Again here is a list :
() No, that is a tuple.
It's a list, you bozo.
() >push( (1,2,3,4,5), 6);
() >This results in an error message, funnily enough the message is :
() >Type of arg 1 to push must be an array (not list)
() Yes. But calling a tuple a list (or for that matter, calling an
() array a list) does not make it one.
Bzzzt. Wrong. Totally wrong. By calling a list a tuple doesn't make
the list a tuple.
() Had that been a real list, and assuming that "push" really means,
() append, that should have been legal.
Of course not. It's illegal on lists, and there is no such thing
as unreal lists in Perl.
() >Still claim perl has no lists?
But we already know your knowledge of Perl isn't worth writing about.
Claim anything you want. It won't carry any weigth.
() >Of course you know better then perl itself.
() In this case, I would say that Perl should use the same terminology
() as other fields of study. So, yes, I would consider that Perl
() makes a mistake, calling this a list.
Perl outdates Python. So there.
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
More information about the Python-list