merits of Lisp vs Python

Ken Tilton kentilton at gmail.com
Sat Dec 16 03:55:21 EST 2006



greg wrote:
> Ken Tilton wrote:
> 
>> I did explain the last little fun bit (where reverse code miraculously 
>> got a case-specific "signed-value" parameter bound to exactly the 
>> right bit of math structure).
> 
> 
> I didn't mention that because it was addressed by
> another poster. The signature of the user's reverse
> function can be made extremely flexible if you have
> the foresight to define it as something like
> 
>    def reverse(resx, opnd, **kwds):
>      ...
> 
> Then you can later change it to
> 
>   def reverse(resx, opnd, signed_value, **kwds):
>      ...
> 
> and any existing reverse functions will just absorb
> and ignore the extra argument.
> 
> However, rather than add an ever-increasing number
> of arguments to the signature, I think I would do it
> a different way: pass a single object with attributes.
> For the want of a better name, let's call it "env"
> for "environment". The signature is then
> 
>   def reverse(env):
>      ...
> 
> and the body can refer to env.resx, env.opnd,
> env.signed_value, or whatever else is required.

Looks promising. How does a generic engine that sees only a solution (a 
list of mathematical expressions and for each the transformations, 
results, and opnds logged by individual TF functions) build up this 
environment such that it has named attributes such as signed-value? 
Assume that it can examine all those opnds and results looking for 
tagged values such that it then knows the name of those values that have 
been named.

ken

-- 
Algebra: http://www.tilton-technology.com/LispNycAlgebra1.htm

"Well, I've wrestled with reality for thirty-five
years, Doctor, and I'm happy to state I finally
won out over it." -- Elwood P. Dowd

"I'll say I'm losing my grip, and it feels terrific."
    -- Smiling husband to scowling wife, New Yorker cartoon



More information about the Python-list mailing list