From: Tom Cloyd Date: 2009-02-01T06:16:56+09:00 Subject: Re: proper use of classes Robert Klemme wrote: > On 31.01.2009 10:02, Tom Cloyd wrote: >> BTW, I was puzzled for years by the mathematical notion of a >> function. It just eluded me. Baffled me. Then, as I was learning to >> program in Fortran, years ago, I began to wonder if there was any >> relation between Fortran functions (hope you know a little Fortran) >> and mathematical functions. Of course, there is. Fortran functions >> was no problem at all to grasp, and once I realized they were just >> another way of expressing a mathematical function (or perhaps I >> should say that a math function can be expressed as a Fortran >> function, and in fact that was what they were for), I was seriously >> rageful. > > IMHO there is an important distinction though which makes Fortran > functions a bad example: mathematical functions usually do not have > side effects, i.e. they can be completely described in terms of input > and output. I view them as a relationship (or call it a mapping) > which assigns particular output values to particular input values. If > I'm not mistaken, a Fortran function can have side effects on > arguments (and probably global variables). A closer analogy are > functions in - you guessed it - functional languages. > > Kind regards > > robert > > Robert - I absolutely agree, and I can to that (or THOSE) understanding(s) in my first pass through grad. school. The idea of a function being a rule that associates two sets of numbers seems to me the most useful. However, the initial breakthrough for me was to see a function as a little program - a process: put something in, get something out. So easy. For some reason, that view it escaped me throughout high school, etc. (I was a writer, not a calculator!). Thanks for your thoughts, as always. I always enjoy what you have to say! Tom -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist Bellingham, Washington, U.S.A: (360) 920-1226 << tc@tomcloyd.com >> (email) << TomCloyd.com >> (website) << sleightmind.wordpress.com >> (mental health weblog) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~