23 lines
507 B
Text
23 lines
507 B
Text
with javascript_semantics
|
|
sequence mtable = {}
|
|
|
|
function multiplier(atom n1, atom n2)
|
|
mtable = append(mtable,{n1,n2})
|
|
return length(mtable)
|
|
end function
|
|
|
|
function call_multiplier(integer f, atom m)
|
|
atom {n1,n2} = mtable[f]
|
|
return n1*n2*m
|
|
end function
|
|
|
|
constant x = 2,
|
|
xi = 0.5,
|
|
y = 4,
|
|
yi = 0.25,
|
|
z = x + y,
|
|
zi = 1 / ( x + y )
|
|
|
|
?call_multiplier(multiplier(x,xi),0.5)
|
|
?call_multiplier(multiplier(y,yi),0.5)
|
|
?call_multiplier(multiplier(z,zi),0.5)
|