Just because that's how Ruby and others implement it doesn't mean RS has to. Those tuple solutions have a lot of code overhead.
One way RS could implement this internally is - as I said - to use "invisible" RB structures as the return value and do the necessary unpacking behind the scenes. This would avoid the added CPU overhead due to having to deal with the genericity and abstraction of tuples. In addition, since such a struct would be "invisible" I cant see a reason why this struct could not also be able to embed stuff that normally cannnot be included in a RB structure, such as class references or array references - in whatever smart-pointer data format RB references are stored. On 26/3/07 15:42, "Norman Palardy" <[EMAIL PROTECTED]> wrote: > > On Mar 26, 2007, at 7:09 AM, Daniel Stenning wrote: > >> All of this "Wrapping" into "tuple" objects - either into dictonaries, >> classes or using structs ?? Just for what might merely be the need >> to return >> two integers ?? its an awful lot of unnecessary tedious activity >> - both on >> the part of us as programmers and the CPU - for what could be a >> very simple >> requirement. > > BUT all these "workarounds" mimic what is really going on in Ruby, > Python, Applescript and almost every other language that has multiple > return values > They all return tuples and they happen to have syntax that unpacks > those tuples for you so you can write > > a,b,c = someFunction() > > In RB because there is no such class as tuple, and no automatic way > to unpack it so you create it yourself. > There's even the start of code for a class to create a tuple in one > of the replies in this thread if you look for it. > > That's software engineering. > > REAL tends to focus on things that are impossible to do in RB without > REAL adding something (language, classes, etc) The things where the > workaround is "None exists" > There is already a means to return multiple values in at several ways > (byref, dictionaries, arrays or the tuple class suggested) > > Submit the request or sign on to it if you want this and see where it > lands > > > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > > Search the archives: > <http://support.realsoftware.com/listarchives/lists.html> > Regards, Dan _______________________________________________________ www.13flatFIVE.com The C++ <> REALbasic code migration specialists _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
