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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b3f07bd1ad77d438 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.87.MISMATCH!news.astraweb.com!border2.a.newsrouter.astraweb.com!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: The state of functional programming Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <2adc4d8d-210e-429c-8188-9b1e99c2718e@d17g2000yqb.googlegroups.com> <1oubrlamjqe8q$.bdwkb9i7ys6b$.dlg@40tude.net> <17hhchqy1a2si.1akul43vk1sd9.dlg@40tude.net> <10uxuyvx8jhq5.1fhpgyjccj85g$.dlg@40tude.net> <8bfjlaFemlU1@mid.individual.net> Date: Fri, 30 Jul 2010 11:29:31 +0200 Message-ID: NNTP-Posting-Date: 30 Jul 2010 11:29:31 CEST NNTP-Posting-Host: bd279ad7.newsspool2.arcor-online.net X-Trace: DXC=0S9424nMVan9kIfcjg:0fdA9EHlD;3Ycb4Fo<]lROoRa8kF On Fri, 30 Jul 2010 12:17:29 +0300, Niklas Holsti wrote: > Dmitry A. Kazakov wrote: >> On Thu, 29 Jul 2010 21:01:35 +0000 (UTC), Warren wrote: >> >>> Dmitry A. Kazakov expounded in >>> news:17hhchqy1a2si.1akul43vk1sd9.dlg@40tude.net: >>> >>>> On Thu, 29 Jul 2010 19:19:49 +0000 (UTC), Warren wrote: >> >>>>> But FP cannot always solve that "problem". >>>> Same in Ada. Not every legal Ada program is compilable. >>> If an Ada program doesn't compile, then the programmer >>> hasn't spelled out the "how" correctly has he? >> >> X : constant := 2**(2**(2**(2**9999_9999))) + 1: >> >> is pretty much clear "how", legal, but not compilable. > > ... because the binary representation of the value of X needs too many > bits, you mean? But I don't think that a compiler is required to > represent the value in binary form *at compile time*; it could use a > formulaic representation, which needs only a small amount of memory, as > shown by your source line. Depending on how X is used in the rest of the > program, this could make it possible to compile the program. Yes, but you cannot find a representation which would work for any legal expression. I.e. whatever representation the compiler uses, it is always possible to write a legal program that would break it. E.g: X : constant := 2**(3**(2**(3**9999_9999))) + 1: Y : constant := 3**(2**(5**(2**8999_9979))) - 1: C : constant Boolean := X > Y; > Of course I agree that a normal Ada compiler will not be able to compile > such things. The above expression is supposed to break representations used by "normal compilers". -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de