From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 7 Apr 92 19:05:13 GMT From: young@purdue.edu (Michal Young) Subject: Re: how pure are functions? Message-ID: <18363@ector.cs.purdue.edu> List-Id: In reply to: > Are they free from internal state? >No. Mark Biggar says: > More then likely that variable is only visible in the body of the package > that defines the function and so is invisible to the user of the function, > but strictly the function itself has no "internal" state. This is true, strictly speaking, but from the viewpoint of a user, verifier, or compiler, Ada functions do not appear to be stateless. For instance, one cannot generally substitute 2*f(x) for f(x) + f(x). There are good practical reasons for not insisting that every "function" be a pure function, but it would be quite helpful if the language provided some way to indicate that certain "functions" were actually functions in the mathematical sense. --Michal Young -- Michal Young