Exploring Solution Spaces © Copyright 2003-2006, by C. Keith Ray
   


About
Exploring Solution Spaces, Keith Ray's blog on Software development and other topics.

Send comments to:
keithray@mac.com

For Agile Training, eLearning, or Coaching contact:
Industrial Logic, Inc.
866-540-8336 (toll free)
510-540-8336 (Berkeley, California)

Links
xpminifaq
Résumé
“Adopting XP” Article 2002 (pdf)
“ Refactoring” Article 2006
AYE Conference
Lucien W. Dupont
Elisabeth Hendrickson
Johanna Rothman's Managing Product Development
Brian Marick's Exploration Through Example
Esther Derby's Insights You Can Use
Laurent Bossavit's Incipient(thoughts)
Dale Emery's Conversations with Dale
Martin Fowler's Bliki
Creating Passionate Users

Archives

  • 2003
  • 2004
  • 2005
  • 2006
  • 2007
  • 2008
  • Subscribe
    RSS Exploring Solution Spaces XML


           
    2004.Jan.08 Thu

    More Python Multiple-Returns

    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.

    [/docs] permanent link

    Data Without Meaning
    Patrick Logan's weblog has the following:

    Jay Han responds to my item on using databases for coordination...

    We know that databases provide concurrency control and transaction management. These features let applications share data -- you can call this coordination at low level. But what about coordination at high level? How can they exchange semantics of data? e.g. "9999-12-31 in date field means now? never? forever in the future?" [...]

    As long as databases only store data, and don't store whole objects (data+algorithms), they will always risk disassociating meaning and values.

    [/docs] permanent link