Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Steve Holden
Paul Rubin wrote: "Fredrik Lundh" <[EMAIL PROTECTED]> writes: Huh? Expressions are not statements except when they're "expression statements"? What kind of expression is not an expression statement? any expression that is used in a content that is not an expression statement, of course. Come on

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Roel Schroeven
Antoon Pardon wrote: Op 2005-01-14, Roel Schroeven schreef <[EMAIL PROTECTED]>: Antoon Pardon wrote: IMO we have a: dogs are mamals kind of relationship in Python. I see what you mean, but I don't think it's true. Every expression can be used where a statement is expected. (And this can be worded

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Fredrik Lundh
Antoon Pardon wrote: > Well IMO I have explained clearly that I understood this in a set > logical sense in my first response. what does "first" mean on your planet? -- http://mail.python.org/mailman/listinfo/python-list

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Antoon Pardon
Op 2005-01-14, Roel Schroeven schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> IMO we have a: dogs are mamals kind of relationship in Python. > > I see what you mean, but I don't think it's true. > >> Every expression can be used where a statement is expected. >> (And this can be worded as: e

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Roel Schroeven
Antoon Pardon wrote: IMO we have a: dogs are mamals kind of relationship in Python. I see what you mean, but I don't think it's true. Every expression can be used where a statement is expected. (And this can be worded as: every expression is a statement.) Not really. An expression statement is a st

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Roel Schroeven
Skip Montanaro wrote: Fredrik> no, expressions CAN BE USED as statements. that doesn't mean Fredrik> that they ARE statements, unless you're applying belgian logic. Hmmm... I'd never heard the term "belgian logic" before. Googling provided a few uses, but no formal definition (maybe it's

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Carl Banks
Tim Jarman wrote: > IANA French person, but I believe that Belgians are traditionally > regarded as stupid in French culture, so "Belgian logic" would be > similar to "Irish logic" for an English person. (Feel free to insert > your own cultural stereotypes as required. :) Ok. http://www.urbandic

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Tim Jarman
Skip Montanaro wrote: > > Fredrik> no, expressions CAN BE USED as statements. that doesn't mean > Fredrik> that they ARE statements, unless you're applying belgian > logic. > > Hmmm... I'd never heard the term "belgian logic" before. Googling > provided a few uses, but no formal d

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Peter Maas
Craig Ringer schrieb: And then we have iteration (generator expressions, list comprehensions, for loops, ...?) over (sequences, iterators, generators) Just sequences and iterators. Generators are functions which return iterators. Sequences and iterators provide two ways to build containers. My

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Carl Banks
Skip Montanaro wrote: > Fredrik> no, expressions CAN BE USED as statements. that doesn't mean > Fredrik> that they ARE statements, unless you're applying belgian logic. > > Hmmm... I'd never heard the term "belgian logic" before. Googling provided > a few uses, but no formal definition (may

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Antoon Pardon
Op 2005-01-14, Fredrik Lundh schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >>> no, expressions CAN BE USED as statements. that doesn't mean >>> that they ARE statements, unless you're applying belgian logic. >> >> No I am applying set logic. Any string that is in the set of >> valid expres

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Skip Montanaro
Fredrik> no, expressions CAN BE USED as statements. that doesn't mean Fredrik> that they ARE statements, unless you're applying belgian logic. Hmmm... I'd never heard the term "belgian logic" before. Googling provided a few uses, but no formal definition (maybe it's a European phrase s

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Antoon Pardon
Op 2005-01-14, Nick Coghlan schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> No I am applying set logic. Any string that is in the set of >> valid expressions is also in the set of valid statements. > > According to Python's grammar, this is not the case. It requires a NEWLINE or > ";" token

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Fredrik Lundh
Antoon Pardon wrote: >> no, expressions CAN BE USED as statements. that doesn't mean >> that they ARE statements, unless you're applying belgian logic. > > No I am applying set logic. Any string that is in the set of > valid expressions is also in the set of valid statements. since you're arguin

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Nick Coghlan
Antoon Pardon wrote: No I am applying set logic. Any string that is in the set of valid expressions is also in the set of valid statements. According to Python's grammar, this is not the case. It requires a NEWLINE or ";" token on the end to turn the expression into a statement. Actually appending

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Antoon Pardon
Op 2005-01-14, Fredrik Lundh schreef <[EMAIL PROTECTED]>: > Paul Rubin wrote: > >>> > Huh? Expressions are not statements except when they're "expression >>> > statements"? What kind of expression is not an expression statement? >>> >>> any expression that is used in a content that is not an expr

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Antoon Pardon
Op 2005-01-13, Terry Reedy schreef <[EMAIL PROTECTED]>: > > "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Op 2005-01-13, Fredrik Lundh schreef <[EMAIL PROTECTED]>: >>> Antoon Pardon wrote: >>> Well, it seems that Guido is wrong then. The documentation clearl

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Fredrik Lundh
Paul Rubin wrote: >> > Huh? Expressions are not statements except when they're "expression >> > statements"? What kind of expression is not an expression statement? >> >> any expression that is used in a content that is not an expression statement, >> of course. > > Come on, that is vacuous. Th

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Paul Rubin
Nick Coghlan <[EMAIL PROTECTED]> writes: > So, precisely how should one go about cleanly embedding something that > cares about whitespace into a context which doesn't care in the > slightest? Treat the macro like a function call whose arguments are thunks made from the macro arguments, or somethi

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Nick Coghlan
Paul Rubin wrote: Come on, that is vacuous. The claim was "expressions are not statements". But it turns out that expressions ARE statements. The explanation is "well, that's because they're expression statements". And there is no obvious case of an expression that can't be used as a statement.

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > > Huh? Expressions are not statements except when they're "expression > > statements"? What kind of expression is not an expression statement? > > any expression that is used in a content that is not an expression statement, > of course. Come on, th

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Fredrik Lundh
Bengt Richter wrote: > Hm, that makes me wonder, is there an intermediate "returning of value" in >x = y = z = 123 > ? no. that statement evaluates the expression (123 in this case), and assigns the result (the integer object 123) to each target (x, y, z), in order. or to quote the languag

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Bengt Richter
On Thu, 13 Jan 2005 09:29:49 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: >Fredrik Lundh wrote: > >> Antoon Pardon wrote: >> >> >>>Well, it seems that Guido is wrong then. The documentation clearly >>>states that an expression is a statement. >> >> >> no, it says that an expression statement

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Fredrik Lundh
Paul Rubin wrote: > Huh? Expressions are not statements except when they're "expression > statements"? What kind of expression is not an expression statement? any expression that is used in a content that is not an expression statement, of course. reading the python language reference should h

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > >>> Well, it seems that Guido is wrong then. The documentation clearly > >>> states that an expression is a statement. > >> > >> no, it says that an expression statement is a statement. if you don't > >> understand the difference, please *plonk* yourself

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Terry Reedy
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Op 2005-01-13, Fredrik Lundh schreef <[EMAIL PROTECTED]>: >> Antoon Pardon wrote: >> >>> Well, it seems that Guido is wrong then. The documentation clearly >>> states that an expression is a statement. >> >> no, it says

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Craig Ringer
On Thu, 2005-01-13 at 08:39 +, Antoon Pardon wrote: > > At best it would offer new paradigms for existing constructs (violating > > the "there should be one obvious way to do it" zen); at worst it would > > obfuscate the whole language. > > That zen is already broken. Look at the number of

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Steve Holden
Fredrik Lundh wrote: Antoon Pardon wrote: Well, it seems that Guido is wrong then. The documentation clearly states that an expression is a statement. no, it says that an expression statement is a statement. if you don't understand the difference, please *plonk* yourself. OK then, "The documenta

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Antoon Pardon
Op 2005-01-13, Fredrik Lundh schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Well, it seems that Guido is wrong then. The documentation clearly >> states that an expression is a statement. > > no, it says that an expression statement is a statement. if you don't > understand the differenc

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Fredrik Lundh
Antoon Pardon wrote: > Well, it seems that Guido is wrong then. The documentation clearly > states that an expression is a statement. no, it says that an expression statement is a statement. if you don't understand the difference, please *plonk* yourself. -- http://mail.python.org/mailman

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Antoon Pardon
Op 2005-01-12, Steve Holden schreef <[EMAIL PROTECTED]>: > > Given that Guido is on record as saying that expressions aren't > statements because he wants those things to be separate, I don't really > see why there's this consistent pressure to reverse that decision. Well, it seems that Guido is

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-12 Thread Steve Holden
Paul Rubin wrote: [EMAIL PROTECTED] writes: I can't imagine how it could be worse than the learning curve of __metaclass__, which we already have. To me, learning macros *and their subtilities* was much more difficult than learning metaclasses. I guess I've only used Lisp macros in pretty straight

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-12 Thread Steve Holden
Paul Rubin wrote: [EMAIL PROTECTED] writes: 2. One could proposed hygienic pattern-matching macros in Python, similar to Scheme syntax-rules macros. Again, it is not obvious how to implement pattern-matching in Python in a non-butt-ugly way. Plus, I feel hygienic macros quite limited and not worth

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-12 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > I can't imagine how it could be worse than the learning curve of > > __metaclass__, which we already have. > > To me, learning macros *and their subtilities* was much more difficult > than learning metaclasses. I guess I've only used Lisp macros in pretty straightfor

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-12 Thread Simo Melenius
[EMAIL PROTECTED] writes: > This is a bizarre idea if you want to make Python run faster. It is > not so bizarre if what you want is to have access to Python from > Lisp/Scheme in the same sense Jython has access to Java. And it sounds very nice if you prefer writing Lisp code (or resort to it if

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-11 Thread michele . simionato
Paul Rubin: > [EMAIL PROTECTED] writes: >> > It wasn't obvious how to do it in Scheme either. There was quite > a bit of head scratching and experimental implementation before > there was consensus. Actually I am not convinced there is consensus yet, i.e. there is a non-negligible minority of s

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > 2. One could proposed hygienic pattern-matching macros in Python, > similar to > Scheme syntax-rules macros. Again, it is not obvious how to > implement pattern-matching in Python in a non-butt-ugly way. Plus, > I feel hygienic macros quite limited and not worth the effo

python and macros (again) [Was: python3: 'where' keyword]

2005-01-11 Thread michele . simionato
Paul Rubin wrote: > How about macros? Some pretty horrible things have been done in C > programs with the C preprocessor. But there's a movememnt afloat to > add hygienic macros to Python. Got any thoughts about that? "Movement" seems quite an exaggeration. Maybe 2-3 people made some experiments,