conceiling function calls..

Emile van Sebille emile at fenx.com
Fri Nov 14 09:34:06 EST 2003


Gonçalo Rodrigues:
> Can you explain why you would want to do that? What possible gain
can
> you have by counfounding name lookup with calling?
>

Well, I can't explain for the OP, but I found it (some years ago...
I'm not sure I'd do the same thing now) convenient in a prototype
minimalist database application.  Data fields could always be inferred
if not actually present in the instance.  Thus when programming you
could write:
    duedate = order.shipdate + order.terms.duedays
without shipdate or terms being attributes of order.

Similarly,
    lineextenion = lineitem.qty * lineitem.price
without price or print the destination address without having
designated a shipto.

This allowed order entry to get along with only the minimum "how many
of what go where" being entered.  Everything else could be swizzled up
when needed if not present.  I specifically wanted the data structure
to be an implementation detail.

--

Emile van Sebille
emile at fenx.com









More information about the Python-list mailing list