Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #88467
| References | (12 earlier) <9781856.5cutuNVPEq@PointedEars.de> <mailman.300.1427615834.10327.python-list@python.org> <3894022.plrvF2nHWu@PointedEars.de> <mailman.362.1427786682.10327.python-list@python.org> <1905422.ubGH1B8UfE@PointedEars.de> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2015-04-02 18:21 -0600 |
| Subject | Re: A simple single line, triple-quoted comment is giving syntax error. Why? |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.26.1428020556.12925.python-list@python.org> (permalink) |
On Thu, Apr 2, 2015 at 3:31 PM, Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote: > Ian Kelly wrote: > >> […] Thomas 'PointedEars' Lahn […] wrote: >>> Ian Kelly wrote: >>>> Within a grammar, the question of "is an X a Y" is nonsensical in >>>> isolation. It can only be answered in relation to a parse tree. >>>> Consider the simple grammar: >>>> >>>> S -> A | B >>>> A -> x >>>> B -> x >>>> >>>> Is x an A? It depends. >>> >>> No, by the definition 2 below, that we all accepted implicitly up to this >>> point, x is *definitely* an A. >> >> What gives you the impression that I ever accepted it? > > ,-<news:mailman.181.1427346636.10327.python-list@python.org> > | > | What the grammar that you quoted from shows is that STRING+ is an > | expression. > > There is *no way* for you to make that statement if you did not accept > definition (2). Actually, there is a very simple way: I was being sloppily imprecise when I wrote that. First, I was speaking only in reference to the class of parse trees with more than one STRING, as that was the topic under discussion. I should have been clearer about that. Second, I never should have used the term "STRING+" there (or anywhere else in this discussion), as that merely clouded the point I was trying to offer. What I *meant* was that the complete sequence of produced STRINGs -- as opposed to any individual STRING -- is an expression, and I inappropriately used "STRING+" to denote that. (Maybe that is the point you were trying to make when you were talking about EBNF before.) >> This question of whether "x is an A" is informal and not a topic of formal >> language theory so far as I'm aware. Can you cite some source for it? > > No, because I was formalizing the ad-hoc definition by Chris Angelico in > <news:mailman.51.1426995416.10327.python-list@python.org>. That URI is not useful to me as I don't use a newsreader. Is that the message dated Sun, 22 Mar 2015 14:36:48 +1100? I don't see any suggestion of this definition in that post. t>>> Now, according to these definitions, in the offered grammar x is *both* >>> an A and a B. Because what matters is _not_ the practical result of >>> production chains (the actual parse tree), but the certainty of the >>> theoretical possibility of it. >> >> This strikes me as being a lot like arguing, "some kites are toys, and >> some kites are birds; therefore, all kites are both toys and birds." > > False analogy again. We are discussing *in theory* a *formal* grammar. Its > goal symbols have *no meaning* except what can be produced from them. We're discussing a formal grammar as if it described a classification hierarchy, which gives meaning to statements like "A STRING is an expr". Otherwise, that statement is meaningless and can be neither true nor false. So I think that the analogy between one such hierarchy and another is apt. >> You're really going to make me spell it out, aren't you? Fine, here you >> go. >> >> single_input -> […] -> expr -> […] -> atom -> STRING STRING >> >> Note: the derivation contains exactly one expr node, which indirectly >> produces both STRINGs. Neither STRING in this derivation is >> individually produced from the expr. > > So you have proven that which nobody ever doubted nor requested, but I > pointed out already. As I tried to point out several posts back when I suggested that we were in agreement, and which you flatly denied. > What you have still not proven is what you claimed: > the parse tree. Because you misunderstood my claim.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-26 05:35 +0100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-25 23:09 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-26 17:45 +0100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-26 12:29 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-26 19:54 +0100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-26 17:27 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-28 19:20 +0100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-29 01:56 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-29 12:41 +0200
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-31 01:23 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? sohcahtoa82@gmail.com - 2015-03-31 16:10 -0700
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Chris Angelico <rosuav@gmail.com> - 2015-04-01 10:36 +1100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-31 17:43 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-02 23:31 +0200
Re: A simple single line, triple-quoted comment is giving syntax error. Why? sohcahtoa82@gmail.com - 2015-04-02 15:26 -0700
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-04-02 18:21 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-03 16:40 +1100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Chris Angelico <rosuav@gmail.com> - 2015-04-03 16:57 +1100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Marko Rauhamaa <marko@pacujo.net> - 2015-04-03 10:13 +0300
r"\"" ??? (was A simple single line, triple-quoted comment) Rustom Mody <rustompmody@gmail.com> - 2015-04-03 05:52 -0700
Re: r"\"" ??? (was A simple single line, triple-quoted comment) Chris Angelico <rosuav@gmail.com> - 2015-04-04 01:40 +1100
Re: r"\"" ??? (was A simple single line, triple-quoted comment) Rustom Mody <rustompmody@gmail.com> - 2015-04-03 08:14 -0700
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-04-03 09:25 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-04-03 00:40 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-03-27 11:43 +1300
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-28 19:06 +0100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-26 12:32 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-26 19:56 +0100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-27 10:15 +1100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Tim Chase <python.list@tim.thechases.com> - 2015-03-26 18:47 -0500
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-26 19:38 -0600
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Marko Rauhamaa <marko@pacujo.net> - 2015-03-27 07:34 +0200
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Dave Angel <davea@davea.name> - 2015-03-26 01:23 -0400
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-26 18:25 +0100
Re: A simple single line, triple-quoted comment is giving syntax error. Why? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-03-26 18:30 +0100
csiph-web