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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Sat, 05 May 2018 16:35:36 -0700 Organization: A noiseless patient Spider Message-ID: <878t8x7k1j.fsf@nightsong.com> References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87k1su7nag.fsf@nightsong.com> <87po2la2qt.fsf@nightsong.com> <87in8buttb.fsf@jacob-sparre.dk> <87wowqpowu.fsf@nightsong.com> <16406268-83df-4564-8855-9bd0fe9caac0@googlegroups.com> <87o9i2pkcr.fsf@nightsong.com> <87in88m43h.fsf@nightsong.com> <87efiuope8.fsf@nightsong.com> <87lgd1heva.fsf@nightsong.com> <87zi1gz3kl.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="a1b938f69dddc3836c7a58a524d03b55"; logging-data="14000"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Lypp3W60XWnOaMUcDISUp" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:e6FTI9Rjx7NaFhAKZ/c9BXQlUWA= sha1:7fJ6LsWZc7pgBydYI+da+v+G5H4= Xref: reader02.eternal-september.org comp.lang.ada:52023 Date: 2018-05-05T16:35:36-07:00 List-Id: "Randy Brukardt" writes: >> If you try to print it, you'll see "1,2,3,1,2,3,1,2,3,1,2,3..." > If you say so. I can't see any sensible way to implement such a thing; The semantics are similar to call-by-name parameter passing in Algol 60. Basically "a : b : c : ..." becomes syntax sugar for a list whose head is the value a, and whose tail is an unevaluated function call. As you iterate down the list, at each iteration you print the head element and call the tail-generating function. The tail-generating function gives you the next element, plus a new tail-generating function that generates the rest of the tail. SICP discusses the pattern at length: http://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-24.html#%_sec_3.5 > In any case, this is an Ada forum and there isn't point about talking about > other languages here, other than to point out how Ada is better. ;-) Ok, fair enough. I try to be a wide-spectrum programmer who doesn't believe in single magic bullets that can solve every problem, so I'm interested in using Ada in its areas of particular strength. So I got sidetracked when this thread headed (as I see it) outside of those areas. But ok, yeah, I'll try to stay more focused here on Ada's strong points, thanks. ;-) I still can't resist posting this article about how its authors seriously simplified the internals of the optimizing compiler they were working on, by replacing a central imperative data structure with a functional one: https://www.cs.tufts.edu/~nr/pubs/zipcfg.pdf Even if the technical details don't make sense, the development experience it describes (dealing with multiple iterations of extending a bug-prone chunk of code) is likely to be familiar for anyone who has worked inside a compiler.