Re: which language allows you to change an argument's value?

2007-09-30 Thread Summercool
On Sep 30, 4:18 am, 7stud -- <[EMAIL PROTECTED]> wrote: > SpringFlowers AutumnMoon wrote: > > we have no way > > of knowing what we pass in could get changed. > > Sure you do. You look at the function's signature. In order to use > someone else's library, you have to know the function's signature

which language allows you to change an argument's value?

2007-09-30 Thread Summercool
I wonder which language allows you to change an argument's value? like: foo(&a) { a = 3 } n = 1 print n foo(n) # passing in n, not &n print n and now n will be 3. I think C++ and PHP can let you do that, using their reference (alias) mechanism. And C, Python, and Ruby probably won't le

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Summercool
On Sep 17, 11:04 pm, Lloyd Linklater <[EMAIL PROTECTED]> wrote: > SpringFlowers AutumnMoon wrote: > > Is that the case: if a is an object, then b = a is only copying the > > reference? > > That and it adds a counter. > > a = ["foo", "bar"] > b = a > b[0] = "bite me" > p a, b > > a = "different" > p

The meaning of a = b in object oriented languages

2007-09-17 Thread Summercool
The meaning of a = b in object oriented languages. I just want to confirm that in OOP, if a is an object, then b = a is only copying the reference. (to make it to the most basic form: a is 4 bytes, let's say, at memory location 0x1000

Re: where are the .pyc files?

2007-09-17 Thread Summercool
On Sep 16, 6:56 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Summercool wrote: > > how come a program that runs directly doesn't need to be optimized > > into bytecode first? Or... is it that the interpreter will just run > > the program as it goes by, without e

Re: where are the .pyc files?

2007-09-16 Thread Summercool
On Sep 16, 10:36 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > The `*.pyc` files are usually only created when you import a module, not > when a module is run directly. how come a program that runs directly doesn't need to be optimized into bytecode first? Or... is it that the inter

where are the .pyc files?

2007-09-16 Thread Summercool
so i have always heard of the .pyc files but for some reason i don't see them on the Windows platform... when i have a program called try.py and after running it for ages, i still don't have a try.pyc file in my folder even if i turn the "show hidden file" to on. -- http://mail.python.org

how to join array of integers?

2007-09-15 Thread Summercool
i think in Ruby, if you have an array (or list) of integers foo = [1, 2, 3] you can use foo.join(",") to join them into a string "1,2,3" in Python... is the method to use ",".join() ? but then it must take a list of strings... not integers... any fast method? -- http://mail.python.org/mailm