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!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 04 May 2018 23:07:04 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Sat, 05 May 2018 00:07:04 -0400 Organization: IISS Elusive Unicorn Message-ID: <08bqedde7vu8h7clp2seqdrvafaobrakcl@4ax.com> References: <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> User-Agent: ForteAgent/8.00.32.1272 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.73.119.179 X-Trace: sv3-Euri8sqUVuqoRaTm7LuOoEdnErwzeh05WHg3lHpVltaY/0eXmTopwwds+EVlTwZCGVVsqUxxHwPd8O8!lcKyxqcCh9/uE/BZfja6RcuhOpuhsPjqv8UTutlaefZXtnxdSAMO00PK+8OVqWIKQZC6ZyD3n2Tv!MBR/AB+euZuv22bRDp/l3hsV60KW X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2997 Xref: reader02.eternal-september.org comp.lang.ada:51999 Date: 2018-05-05T00:07:04-04:00 List-Id: On Fri, 4 May 2018 18:29:17 -0500, "Randy Brukardt" declaimed the following: >"Paul Rubin" wrote in message >news:87zi1gz3kl.fsf@nightsong.com... >> This list contains a reference to itself: >> >> x = 1 : 2 : 3 : x > >And is illegal in any reasonable programming language... ;-) > >> If you try to print it, you'll see "1,2,3,1,2,3,1,2,3,1,2,3..." ad >> infinitum until you interrupt the program. It is infinitely long, but >> occupies a finite amount of memory. > >If you say so. I can't see any sensible way to implement such a thing; >indeed I would have said it was impossible to implement but apparently you >have an example to the contrary. > Not as a one-liner... but... PythonWin 2.7.13 (default, Jun 26 2017, 14:28:43) [MSC v.1500 64 bit (AMD64)] on win32. Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information. >>> x = [1, 2, 3] >>> x.append(x) >>> print x [1, 2, 3, [...]] >>> Slight difference is that the entire list becomes an element, it is not a one level sequence of repeating entities (older version of Python would recursively print until a limit on recursion was reached [1, 2, 3, [1, 2, 3, [1, 2, 3, [ etc -- newer ones detect the recursion and use the [...] notation) -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/