How do call this symbolic code transformation ?

Posted by erric on Stack Overflow See other posts from Stack Overflow or by erric
Published on 2010-05-28T14:01:11Z Indexed on 2010/05/28 14:01 UTC
Read the original article Hit count: 161

Hi,

I often cross this kind of code transformation (or even mathematical transformation)

(python example, but applies to any language)

I've go a function

def f(x): return x

I use it into another one.

def g(x): return f(x)*f(x)

print g(2) leads to 4

But I want to remove the functional dependency, and I change the function g into

def g(f): return f*f print g( f(2) ) leads to 4 too

How do you call this kind of transformation, locally turning a function into a scalar ?

© Stack Overflow or respective owner

Related posts about symbolic

Related posts about program-transformation