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: Thu, 10 May 2018 12:32:19 -0700 Organization: A noiseless patient Spider Message-ID: <87o9hn1f3w.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> <87y3gt6dhm.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="8ee8a87c586ad688bbbd7b3afaf6ee4e"; logging-data="13907"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jI/POzZC4e3Wi44Pufl34" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:T5JjlSSS2SX6flx/W7ls+zuBpLM= sha1:9+Act+MraEmYLgnw52ggzwguX4g= Xref: reader02.eternal-september.org comp.lang.ada:52205 Date: 2018-05-10T12:32:19-07:00 List-Id: Niklas Holsti writes: >> and there's an explicit reference there. > Thanks, this explains it. Note though that the need for the explicit reference is a consequence of the type system, not something inherent in the concept of corecursion. In a lazy version of Scheme you could write that list without any explicit self-reference using the Y combinator, Y = λf. (λx. f (x x)) (λx. f (x x)) (Don't ask me to explain how that works, but there is a description in Wikipedia). It's just that the Y combinator can't be written under a Haskell-style type system, and it allows you to implement unrestricted recursion.