Bill Allombert on Mon, 18 Jun 2018 17:32:30 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Rational functions equal almost everywhere, but not for "subst"


On Sun, Jun 17, 2018 at 10:21:16AM +0000, Jacques Gélinas wrote:
> Thanks for the very detailed explanations for the parameter and 
> global variable link difference between 2.4.1 and 2.5+.

Note: you can recover the old behaviour by adding 
local(a=a); at the start of your function, when a is the parameter name
you want to be dynamically scoped:

g(x)=x+a

f(x,a)=
{ 
  local(a=a);
  g(x)
}

? f(4,5)
%3 = 9

Cheers,
Bill.