[Tutor] list as a first class citizen in python? [languagecomparisons!]

Karthik Gurumurthy karthikg@aztec.soft.net
Wed, 26 Dec 2001 14:41:38 +0530


oops sorry !
am not sure if the code is ok with perl.
i just wanted to ask if a function expects 2 arguments, i can send in a list
w/o using an apply.
they don't have to be specified separately while making the function call.

karthik.


-----Original Message-----
From: karthik Guru [mailto:karthikg@aztec.soft.net]
Sent: Wednesday, December 26, 2001 2:35 PM
To: Danny Yoo
Cc: tutor@python.org
Subject: RE: [Tutor] list as a first class citizen in python?
[languagecomparisons!]
Importance: High


thanks ,
from your code snippet, the list thing in perl seems odd though.
everything gets flattened out in the end? unless i do somethign about it.
So this w'd work in perl then??

//function definition
def func(a,b):


//arguments
args = [1,2]
//call function
func(args)

so they don't need an apply as we do in python?
now am not sure which one is better. having learnt java first, i w'd go with
python :-)
am not qualified enough to make comparisons, but i was confused  by these
lines
i found...

>This forces people to think about references, again
>So much for lists being first class citizens!

thanks. have to do a read up on the "first class" things though.

karthik.