Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #88461

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.python
Subject Re: A simple single line, triple-quoted comment is giving syntax error. Why?
Date 2015-04-02 23:31 +0200
Organization PointedEars Software (PES)
Message-ID <1905422.ubGH1B8UfE@PointedEars.de> (permalink)
References (11 earlier) <mailman.223.1427412471.10327.python-list@python.org> <9781856.5cutuNVPEq@PointedEars.de> <mailman.300.1427615834.10327.python-list@python.org> <3894022.plrvF2nHWu@PointedEars.de> <mailman.362.1427786682.10327.python-list@python.org>

Show all headers | View raw


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).

>> (2) Let the statement “x is an A” be true if x can be produced in a
>>     production chain starting with or including the non-terminal A
>>     left-hand side –
>>
>>       x ∈ A ↔ ∃A (… ⇒ A ⇒ … ⇒ x).
> 
> Sorry, but this definition just seems entirely arbitrary to me.

It is just the formalization of the definition that we all have agreed to, 
including you.

> Mathematically, it looks nonsensical; A is a symbol, not a set.

“A” is the goal symbol of a production, so it can be interpreted as the 
superset of all set of terminals that can be produced from it, through the 
goal symbols that can be produced from it.  And all of us implicitly did 
that when we said “STRING(+) (literals) is/are (not) (an) expression(s)”.

> 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>.

>> 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.

> As noted above, the inaccuracy that Gregory pointed out has no bearing
> on my argument.

But it does.

> 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.  What you have still not proven is what you claimed: 
the parse tree.

I am sorry that you cannot see that your argument is strewn with gaping 
defects in logic, but I think I will stop trying to convince you of that 
now.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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