From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: The future of Spark . Spark 2014 : a wreckage Date: Fri, 12 Jul 2013 08:25:15 +0100 Organization: A noiseless patient Spider Message-ID: References: <7ebe0439-fa4c-4374-a6c7-365ac78e6e39@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="c8504a89c76ea11bda6664e6198ae3cd"; logging-data="2399"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/UKpkj7FzmYvasRficRXEa9BnCuHXaqqk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:r+wEwbDCLxZ9j0c207P2Z2ayGJg= sha1:fK6vmGhbEE8jRkbLJErheJMU7DQ= X-Original-Bytes: 2146 Xref: number.nntp.dca.giganews.com comp.lang.ada:182484 Date: 2013-07-12T08:25:15+01:00 List-Id: "Randy Brukardt" writes: > GNAT has a pragma Pure_Function which can be used on a single > function. This isn't in Ada because it is just an assumption; there is > no checks at all whether it is true. In that case, any mistake in the > function would make a program calling it erroneous (because the > compiler is allowed to assume the function is pure, even if it > isn't). It can only be made safe if it is combined with a proof that > there are no side-effects, in which case it surely should never be > separated from that proof -- but pragmas are *always* separated from > the thing they apply to. As such, they are never appropriate for > setting properties of single entities. GNAT supports Pure_Function as an aspect; so you can write package Pf is function F (X : Integer) return Integer with Pure_Function; end Pf;