[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: recursive loop in XSL stylesheet is failing
On 25/03/2010 16:00, Kerry, Richard wrote:
the terminology matches all uses that I'm aware of including mathematics and fairly old computer languages such as lisp and newer functional languages such as ML, haskell, F#, etc. When I was first shown programming (fortran and algol) in the 70's a big deal was made that "variable" in those languages was a strange computer-related thing that didn't mean what you would expect it to mean and that x=x+1 was ok despite the fact that it was clearly nonsense in mathematics. A few decades later and there seem to be people so exposed to this usage that they have convinced themselves that it is somehow natural:-) > as they aren't (variable that is). They're as variable as they are in C, it's just that in C a variable declared as int (say) is associated (abstractly) to a pointer to an integer and you can change the value of the integer pointed to while still being the "same variable" (that is, the variable holds the same pointer) but in functional languages when you bind an integer to a variable the variable holds the integer itself (conceptually: an implementation may well use c or java variables in the background) so while you can bind another integer to a variable of the same name it's a completely new variable in that case, unrelated to the first. I remaind slightly suspicious of the implication that they have a meaning in mathematics. I thought they were called "values" there. you were never asked to solve the equation x*x = 4, for the variable x ?? In the above 4 is a value and x is a variable or an unknown. In functional languages, as in life, if you have a "function of one variable" then within the body of that function, the variable will have the same value: a function returns a result, it never[1] causes its input to mutate. the "variable" terminology refers to the fact that you can call the function multiple times with the input value varying. In imperative languages this is not the case, f(x) may change x, which makes lots of things counter-intuitive and makes lots of "obvious" optimisations incorrect. as for example f(x) + f(x) can't be simplified to 2*f(x) as the value of x may have changed after the first call to f.
David [1] never say never: real computer languages may make this statement slightly false, but never let details spoil a dogmatic argument;-) ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|