On Mar 23, 2007, at 7:52 PM, Guyren Howe wrote: > On Mar 23, 2007, at 8:48 PM, Guyren Howe wrote: > >> Why should returning a single value be easy but multiple values be a >> pain in the proverbial? I don't see anything special about returning >> one value. > > Is there no-one else on this mailing list who uses any of the many > languages that have multiple return values who will jump in here and > confirm that, in fact, this turns out not to be a huge mis-feature in > those languages, that it works fine, that it does not *actually* > cause your hair to turn out or require you to sacrifice your first- > born?
Yep... Pascal (1978 to present) here - works just as well as any coding... as long as intent is well documented, whether "BYREF" or "VAR" or "&", they mean the same, simply a parameter defined as capable of both input and output. Keep in mind that all languages compile into and execute machine code; and all machines and memory management chips allow the very same memory address, or block of addresses to be defined as both readable and writable. Therefore, all languages must support that ability. Using that ability is a call made for each project, I prefer to use whatever clearly states what is happening at that point. Here is a scary thought: in Pascal we have Procedures which are Functions that have no declared return value, BUT, using the keyword VAR, you can modify a passed value!!! Or have multiple, modifiable passed parameters!!!! Or, have a Function with multiple, modifiable passed parameters and it returns a value. Just waiting for code abuse, yes? Or, skip the VAR, and sneak in pointers - now we can modify the content of the block the pointer is pointing to without declaring it! Nyahahahahhhhh!!! Just imagine the bugs and crashes we can create!!!! Wirth was an evil genius.... All languages also support bad style, side effects, and bugs. Code responsibly and consistently. Code as if your professional heirs will need to understand it 20 years from now. Such projects are real, the Mac is 23 years old, I have current shipping code based on source files maintained for 21 years and counting. If you use your programming superpowers wisely and pay your syntax, your first-born will turn out just fine and you won't sacrifice your hair.... :-) Gary "can't resist a straight line" Pulis back to work... _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
