Re: Return in function
- To: mathgroup at smc.vnet.net
- Subject: [mg105694] Re: Return in function
- From: "Nasser M. Abbasi" <nma at 12000.org>
- Date: Wed, 16 Dec 2009 06:15:35 -0500 (EST)
- References: <hg7vac$eq9$1@smc.vnet.net>
"Bill Rowe" <readnews at sbcglobal.net> wrote in message news:hg7vac$eq9$1 at smc.vnet.net... > On 12/14/09 at 12:04 AM, nma at 12000.org (Nasser M. Abbasi) wrote: > >>"David Bailey" <dave at removedbailey.co.uk> wrote in message >>news:hg2d7s$j8a$1 at smc.vnet.net... > >>>Aren't you being a bit unfair, Daniel has obviously taken time to >>>thin out this example from whatever complicated context he found it >>>in originally - minimal examples of problems often don't make >>>sense:) > >>Not only that, but if someone can write code in any language such as >>the output is "unpredictable" then there is something really wrong >>in this picture. > >>No one should be able to write code in a well defined language such >>that the output becomes "unpredictable". We are not dealing with the >>heisenberg uncertainty principle here. May be the code is hard to >>understand, ok, but "unpredictable"? > > You are being way over simplistic here. Any general purpose > programming language includes the capability of making arbitrary > edits to existing files. That implicitly means I can always > generate code which will cause unpredictable results. > > =46urther, a design goal of Mathematica appears to be the ability > to do anything that is possible in Mathematics. Given that goal > and Godel's theorem, it will always be possible to generated > code which has unpredictable results. > > Dictionary defines unpredictable as unknown in advance; "an unpredictable (or indeterminable) future" I think may be there is a mixing between "result" of code, with "behavior" of code? When I type Random[], the behavior is predictable, it will generate random number from the distribution that Random[] is defined at. The exact result itself is "unpredictable", since it is ofcourse random. I can't in advance, know the value that this call will result in. But one can certainly say that the behavior of the code Random[] is predictable: It will generate a random number drawn from some distribution. If someone looks at a piece of code, and then say the result of this code is "unpredictable", not because the result is a random number, but just because of the way the code is written, then there is something wrong with the language itself, because this means the definition of the language _itself_ is undefined, so as one is unable to decide how the language will behave in this case. We are talking about a computer programming language here. I doubt very much one call sell a computer language to the Federal Aviation Administration to write an aircraft guidance system if one tell them that it is possible to write code in this language whose behavior can not be predicted in advance. --Nasser