Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '16,': 0.03; 'json': 0.07; 'string': 0.09; 'converted': 0.09; 'definition,': 0.09; 'identifier': 0.09; '"."': 0.16; '(it': 0.16; '::=': 0.16; 'arbitrarily': 0.16; 'attributeref': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'janssen': 0.16; 'reliably': 0.16; 'typedef': 0.16; 'valid.': 0.16; 'elements': 0.16; 'so.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'translated': 0.19; '>>>': 0.22; 'bruce': 0.22; "aren't": 0.24; 'circular': 0.24; 'primary': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'keys': 0.31; 'though.': 0.31; 'comment': 0.34; 'skip:d 20': 0.34; "can't": 0.35; 'definition': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'words,': 0.36; 'ends': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'explain': 0.39; 'to:addr:python.org': 0.39; 'simple': 0.61; 'back': 0.62; 'between': 0.67; 'stated': 0.69; '(ie': 0.84; '5.3.1': 0.84; 'technically': 0.84; 'valid,': 0.84; 'rusi': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=6fAuVDbCqr4C/HmoCGtdwzrJiBIAxI22Ilvpq1D/VVI=; b=m38+KokFjS9gPnDMPntFa0CxAc0U92ctmiVa9KwQEHiFIQ/duFcW4dnZk3TCZ59xB0 eMS7P/M7wM4eW+Myd6bt5Caf8L1Dq1bHrsYGZ1hNZmgrRU6GO2wQ/mbiEUpGz7NbTHSt z7qHauDVCRcYpBG8TEWN0dGhltBz4ZV5zFKSTv9PdWroEodI7KS3njBjyLQBZYz5ndS1 rhR09EX9DAuDR3/fk4XhM3oVlfVurSOPXm+uKiPjM6/Tc4zZryxzjST3xXPTkKxI+tRj g09rwxCkVLz1e8M3HniHAm/ONsAYekqctkPtX/6azaBbami2gkjEzGILrMbcwleudUUJ ClpQ== MIME-Version: 1.0 X-Received: by 10.58.75.46 with SMTP id z14mr6712538vev.52.1366250210136; Wed, 17 Apr 2013 18:56:50 -0700 (PDT) In-Reply-To: References: <66e78281-542b-41b3-a56d-04bf736d1e0a@googlegroups.com> <14a9ca59-218d-4dec-9e03-b7ac6b92d378@af5g2000pbd.googlegroups.com> Date: Thu, 18 Apr 2013 11:56:50 +1000 Subject: Re: Atoms, Identifiers, and Primaries From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366250219 news.xs4all.nl 2175 [2001:888:2000:d::a6]:39269 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43798 On Thu, Apr 18, 2013 at 9:40 AM, Mark Janssen wrote: > On Tue, Apr 16, 2013 at 8:55 PM, rusi wrote: >> On Apr 17, 7:57 am, Bruce McGoveran wrote: >>> 3. Section 5.3.1 offers this definition of an attributeref: >>> attributeref ::= primary "." identifier >>> >> >> One general comment I will make is regarding your distress at what you >> call 'circular' >> Circular just means recursive and recursion is the bedrock for >> language-design. > > Rercursion the "bedrock" of language-design. I don't think so. From > what I know, a well-defined language ends at its symbols. It makes no > use of "infinities". There's a difference between infinite and recursive, though. I was defining a function (it converted from JSON to an internal format) and wanted to explain that not all of JSON would reliably round-trip (ie be able to be translated to the internal format and then back again). To describe what _would_ round-trip correctly, I used this simple yet technically illegal description: typedef valid string|array(valid)|object(string:valid) In other words, a string is valid, and a list/array of valid elements is valid, and a dictionary/mapping/object with string keys and valid elements is valid. It's a recursive definition, but it can't go infinite (self-references aren't valid - though this isn't stated by the typedef); however, it can go arbitrarily deep. ChrisA