realbasic-betas.mbox
[Top] [All Lists]

Re: Ability to have more than one Lvalue

To: REALbasic Betas <realbasic-betas at lists dot realsoftware dot com>
Subject: Re: Ability to have more than one Lvalue
From: David Shaw <osx at mac dot com>
Date: Sun, 28 Jul 2002 14:15:57 -0400
>> There is also a feature request (that I think we should *not* make for
>> RB) that would have functions able to return more than one value. So you
>> could do something like:
>> 
>> (a, b) = foo(3)
>> 
>> where foo returns two values.

Python offers this, and it's a great feature.  Python uses a immutable data
type called a tuple to group objects in the return. This allows for stuff
like this:

> myString = "a,b,c,d"

> splitstring = string.split(myString, ",")

> print splitstring

('a', 'b', 'c', 'd')

> print(splitstring[2])

'c'




<Prev in Thread] Current Thread [Next in Thread>