| Exploring Solution Spaces © Copyright 2003-2006, by C. Keith Ray | ||||||||||||||||||||||||
|
Archives
Subscribe |
2004.Jan.08 Thu John Roth, via email, tells me that "multiple-return" like this: quotient, remainder = divmod(divisor, dividend) is actually a syntactic short-cut for this: result = divmod(divisor, dividend) quotient = result[0] remainder = result[1] The divmod function returns a tuple (an immutable list) and the language automatically unpacks it for you. When I wrote my earlier blog entry, I actually did think of the this "divmod" function... except I couldn't recall the exact name (almost remembered the Forth equivalent, useless in this context), and I was, of course, too lazy to look it up in the Python docs. Once on comp.lang.smalltalk, there was a discussion on how hard it would be to add increment-assignment to Squeak's Smalltalk compiler. Someone posted the actual code, and it was only a few short modified methods. I expect that automatic-unpacking, ala Python "Multiple-Returns", would also be a small modification to the compiler, that most Smalltalk environments could support each in their own way.
Data Without Meaning
As long as databases only store data, and don't store whole objects (data+algorithms), they will always risk disassociating meaning and values. |
|||||||||||||||||||||||