Re: unicode as valid naming symbols

2014-04-02 Thread Marko Rauhamaa
Rustom Mody rustompm...@gmail.com: On Wednesday, April 2, 2014 8:28:02 AM UTC+5:30, Rustom Mody wrote: In scheme, in a named-let, the name chosen was very often 'loop' Umm... I see from your prime number example that there are nested loops in which sometimes you restart the inner and

Re: unicode as valid naming symbols

2014-04-01 Thread Antoon Pardon
On 01-04-14 02:47, Ian Kelly wrote: On Mon, Mar 31, 2014 at 1:31 PM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 31-03-14 19:40, Ian Kelly schreef: That was an exaggeration on my part. It wouldn't affect my job, as I wouldn't expect to ever actually have to maintain anything like

Re: unicode as valid naming symbols

2014-04-01 Thread Ian Kelly
On Tue, Apr 1, 2014 at 2:19 AM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: On 01-04-14 02:47, Ian Kelly wrote: On Mon, Mar 31, 2014 at 1:31 PM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Second of all I think a good chosen symbolic name can be more readable than a name in a

Re: unicode as valid naming symbols

2014-04-01 Thread Marko Rauhamaa
Ian Kelly ian.g.ke...@gmail.com: On Tue, Apr 1, 2014 at 2:19 AM, Antoon Pardon Which will give me the normal result. Maybe I missed it but I haven't heard scheme being called an unreadable language. Well, I have, but I think that usually has more to do with an excess of parentheses. If you

Re: unicode as valid naming symbols

2014-04-01 Thread Ian Kelly
On Tue, Apr 1, 2014 at 3:32 AM, Marko Rauhamaa ma...@pacujo.net wrote: Ian Kelly ian.g.ke...@gmail.com: On Tue, Apr 1, 2014 at 2:19 AM, Antoon Pardon Which will give me the normal result. Maybe I missed it but I haven't heard scheme being called an unreadable language. Well, I have, but I

Re: unicode as valid naming symbols

2014-04-01 Thread Antoon Pardon
On 01-04-14 11:18, Ian Kelly wrote: On Tue, Apr 1, 2014 at 2:19 AM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: On 01-04-14 02:47, Ian Kelly wrote: Well, this is the path taken by APL. It has its supporters. It's not known for being readable. No that is not the path taken by APL.

Re: unicode as valid naming symbols

2014-04-01 Thread Chris Angelico
On Tue, Apr 1, 2014 at 8:58 PM, Ian Kelly ian.g.ke...@gmail.com wrote: Setting aside the fact that C doesn't have anonymous functions, I'll approximate it as best I can: static int n = 3; int f() { return n; } int main() { n = 7; return f(); } C: 10 Scheme: 20 And

Re: unicode as valid naming symbols

2014-04-01 Thread Chris Angelico
On Tue, Apr 1, 2014 at 9:37 PM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Python also uses symbols for names of operations, like '+'. And when someone suggested python might consider increasing the number of operations and gave some symbols for those extra operations, nobody suggested

Re: unicode as valid naming symbols

2014-04-01 Thread Marko Rauhamaa
Ian Kelly ian.g.ke...@gmail.com: Setting aside the fact that C doesn't have anonymous functions, I'll approximate it as best I can: [...] C: 10 Scheme: 20 It is true that scheme needs parentheses for operators and assignments so the ratio is probably in the order of 2:1. Whether that is

Re: unicode as valid naming symbols

2014-04-01 Thread Antoon Pardon
On 01-04-14 12:58, Chris Angelico wrote: But because, in the future, Python may choose to create new operators, the simplest and safest way to ensure safety is to put a boundary on what can be operators and what can be names; Unicode character classes are perfect for this. It's also possible

Re: unicode as valid naming symbols

2014-04-01 Thread Roy Smith
In article mailman.8796.1396354601.18130.python-l...@python.org, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: On 01-04-14 12:58, Chris Angelico wrote: But because, in the future, Python may choose to create new operators, the simplest and safest way to ensure safety is to put a

Re: unicode as valid naming symbols

2014-04-01 Thread Chris Angelico
On Tue, Apr 1, 2014 at 11:02 PM, Marko Rauhamaa ma...@pacujo.net wrote: #includestdio.h int main() { int n, i = 3, count, c; printf(Enter the number of prime numbers required\n); scanf(%d,n); if ( n = 1

Re: unicode as valid naming symbols

2014-04-01 Thread Chris Angelico
On Tue, Apr 1, 2014 at 10:59 PM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: On 01-04-14 12:58, Chris Angelico wrote: But because, in the future, Python may choose to create new operators, the simplest and safest way to ensure safety is to put a boundary on what can be operators and what

Re: unicode as valid naming symbols

2014-04-01 Thread Chris Angelico
On Tue, Apr 1, 2014 at 11:29 PM, Roy Smith r...@panix.com wrote: But I confess that is mostly personal taste, since I find names_like_this ugly. Names-like-this look better to me but that wouldn't be workable in python. But maybe there is some connector that would be aestetically pleasing and

Re: unicode as valid naming symbols

2014-04-01 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: I don't find it more readable to cast something as recursive; compare these two tight loops: (let find-divisor ((c 2)) (cond ((= c i) (format #t ~S\n i) (display-primes (1+ count) (1+ i)))

Re: unicode as valid naming symbols

2014-04-01 Thread Chris Angelico
On Wed, Apr 2, 2014 at 12:16 AM, Marko Rauhamaa ma...@pacujo.net wrote: I implemented the loops in the scheme way. Recursion is how iteration is done by the Believers. Traditional looping structures are available to scheme, but if you felt the need for them, you might as well program in

Re: unicode as valid naming symbols

2014-04-01 Thread Ned Batchelder
On 4/1/14 9:00 AM, Chris Angelico wrote: On Tue, Apr 1, 2014 at 10:59 PM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: On 01-04-14 12:58, Chris Angelico wrote: But because, in the future, Python may choose to create new operators, the simplest and safest way to ensure safety is to put a

Re: unicode as valid naming symbols

2014-04-01 Thread Rustom Mody
On Tuesday, April 1, 2014 6:38:14 PM UTC+5:30, Chris Angelico wrote: On Tue, Apr 1, 2014 at 11:29 PM, Roy Smith wrote: But I confess that is mostly personal taste, since I find names_like_this ugly. Names-like-this look better to me but that wouldn't be workable in python. But maybe there

Re: unicode as valid naming symbols

2014-04-01 Thread Chris Angelico
On Wed, Apr 2, 2014 at 12:33 AM, Ned Batchelder n...@nedbatchelder.com wrote: Maybe I'm misunderstanding the discussion... It seems like we're talking about a hypothetical definition of identifiers based on Unicode character categories, but there's no need: Python 3 has defined precisely that.

Re: unicode as valid naming symbols

2014-04-01 Thread Rustom Mody
On Tuesday, April 1, 2014 7:14:15 PM UTC+5:30, Chris Angelico wrote: On Wed, Apr 2, 2014 at 12:33 AM, Ned Batchelder wrote: Maybe I'm misunderstanding the discussion... It seems like we're talking about a hypothetical definition of identifiers based on Unicode character categories, but

Re: unicode as valid naming symbols

2014-04-01 Thread Ian Kelly
On Tue, Apr 1, 2014 at 7:44 AM, Chris Angelico ros...@gmail.com wrote: On Wed, Apr 2, 2014 at 12:33 AM, Ned Batchelder n...@nedbatchelder.com wrote: Maybe I'm misunderstanding the discussion... It seems like we're talking about a hypothetical definition of identifiers based on Unicode

Re: unicode as valid naming symbols

2014-04-01 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: On Wed, Apr 2, 2014 at 12:16 AM, Marko Rauhamaa ma...@pacujo.net wrote: I implemented the loops in the scheme way. Recursion is how iteration is done by the Believers. Then I'm happily a pagan who uses while loops instead of recursion. Why should every loop

Re: unicode as valid naming symbols

2014-04-01 Thread Rustom Mody
On Tuesday, April 1, 2014 9:29:27 PM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : On Wed, Apr 2, 2014 at 12:16 AM, Marko Rauhamaa wrote: I implemented the loops in the scheme way. Recursion is how iteration is done by the Believers. Then I'm happily a pagan who uses while loops

Re: unicode as valid naming symbols

2014-04-01 Thread Rustom Mody
On Wednesday, April 2, 2014 8:28:02 AM UTC+5:30, Rustom Mody wrote: On Tuesday, April 1, 2014 9:29:27 PM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : On Wed, Apr 2, 2014 at 12:16 AM, Marko Rauhamaa wrote: I implemented the loops in the scheme way. Recursion is how iteration is

Re: unicode as valid naming symbols

2014-03-31 Thread Antoon Pardon
On 27-03-14 17:22, Ian Kelly wrote: On Thu, Mar 27, 2014 at 9:28 AM, Mark H Harris harrismh...@gmail.com wrote: Do you think that the ability to write this would be an improvement? import ⌺ ⌚ = ⌺.╩░ ⑥ = 5*⌺.⋨⋩ ❹ = ⑥ - 1 ♅⚕⚛ = [⌺.✱✳**⌺.❇*❹{⠪|⌚.∣} for ⠪ in ⌺.⣚] ⌺.˘˜¨´՛՜(♅⚕⚛) Steven,

Re: unicode as valid naming symbols

2014-03-31 Thread Ian Kelly
On Mon, Mar 31, 2014 at 3:55 AM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: On 27-03-14 17:22, Ian Kelly wrote: On Thu, Mar 27, 2014 at 9:28 AM, Mark H Harris harrismh...@gmail.com wrote: Do you think that the ability to write this would be an improvement? import ⌺ ⌚ = ⌺.╩░ ⑥ =

Re: unicode as valid naming symbols

2014-03-31 Thread Tim Chase
On 2014-03-31 11:40, Ian Kelly wrote: There is nothing useful you can do with a name that is the U+1F4A9 character that you can't do just as easily with alphanumeric identifiers like pile_of_poo (or куча_фекалий if one prefers; that's auto-translated, so don't blame me if it's a poor

Re: unicode as valid naming symbols

2014-03-31 Thread Ian Kelly
On Mon, Mar 31, 2014 at 12:02 PM, Tim Chase python.l...@tim.thechases.com wrote: On 2014-03-31 11:40, Ian Kelly wrote: There is nothing useful you can do with a name that is the U+1F4A9 character that you can't do just as easily with alphanumeric identifiers like pile_of_poo (or куча_фекалий

Re: unicode as valid naming symbols

2014-03-31 Thread Antoon Pardon
Op 31-03-14 19:40, Ian Kelly schreef: On Mon, Mar 31, 2014 at 3:55 AM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: On 27-03-14 17:22, Ian Kelly wrote: On Thu, Mar 27, 2014 at 9:28 AM, Mark H Harris harrismh...@gmail.com wrote: Do you think that the ability to write this would be an

Re: unicode as valid naming symbols

2014-03-31 Thread Terry Reedy
On 3/31/2014 1:40 PM, Ian Kelly wrote: Second, at least in the case of decorators, while I don't dispute that they can harm readability, I think that in the majority of cases they actually help it. That's because the @ syntax placed before a function or class clearly denotes that the construct

Re: unicode as valid naming symbols

2014-03-31 Thread Terry Reedy
On 3/31/2014 3:31 PM, Antoon Pardon wrote: Op 31-03-14 19:40, Ian Kelly schreef: First, because while those may degrade readability, they do so in a constrained way. A decorator application is just the @ symbol and an identifier. And if abused, can totally change the working of your

Re: unicode as valid naming symbols

2014-03-31 Thread Marko Rauhamaa
Terry Reedy tjre...@udel.edu: @twist_the_function_meaning def f: return clear_expression is no worse in this regard than the written out form def f: return clear_expression f = twist_the_function_meaning(f) I don't remember feeling the need for either. I have written wrappers of all

Re: unicode as valid naming symbols

2014-03-31 Thread Ian Kelly
On Mon, Mar 31, 2014 at 1:31 PM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 31-03-14 19:40, Ian Kelly schreef: That was an exaggeration on my part. It wouldn't affect my job, as I wouldn't expect to ever actually have to maintain anything like the above. My greater point though is

Re: unicode as valid naming symbols

2014-03-31 Thread David Hutto
I personally believe that it becomes hard to have even a programming language overcome cultural learning styles, and programmatic differences, because of nurture vs nature. We can all program something which results in a similar return value, but overcoming the nurturing the internet provides,

Re: unicode as valid naming symbols

2014-03-31 Thread David Hutto
This brings us into a juxtaposition between how cultures have tried to hybridize their mentalities, into more of an empathic means of communication via a formulatic set of coding, and the philosophy thereof, and, 3D renderings of what we visualize, and how we come to the conclusions of these

Re: unicode as valid naming symbols

2014-03-30 Thread Gregory Ewing
Chris Angelico wrote: a 5x8 bitmap has forty pixels, any of which can be either on or off - that gives roughly twice as much data space as the 21-bit Unicode spec. We don't need a font, then -- just map the pixels straight onto bits in the character code! Might require some user re-education,

Re: unicode as valid naming symbols

2014-03-29 Thread Chris Angelico
On Sun, Mar 30, 2014 at 5:11 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: Considering that a 5x8 bitmap font (which is unlikely to even have enough pixels to produce even 65536 unique glyphs) would take 5.6MB for your (17*65536), I wouldn't want to see what an algorithmic

Re: unicode as valid naming symbols

2014-03-28 Thread random832
On Thu, Mar 27, 2014, at 11:10, Rustom Mody wrote: Just out of curiosity how do/did you type that? When I see an exotic denizen from the unicode-universe I paste it into emacs and ask Who are you? But with your 'def' my emacs is going a bit crazy! Your emacs probably is using UCS-2 or

Re: unicode as valid naming symbols

2014-03-28 Thread Rustom Mody
On Saturday, March 29, 2014 12:25:45 AM UTC+5:30, rand...@fastmail.us wrote: On Thu, Mar 27, 2014, at 11:10, Rustom Mody wrote: Just out of curiosity how do/did you type that? When I see an exotic denizen from the unicode-universe I paste it into emacs and ask Who are you? But with your

Re: unicode as valid naming symbols

2014-03-28 Thread Chris Angelico
On Sat, Mar 29, 2014 at 4:00 PM, Rustom Mody rustompm...@gmail.com wrote: My current diagnosis (with the help of more knowledgeable folks than myself) is that its a font problem. There simply doesn't exist a font (or more likely I dont know of) that - is readable - is scaleable - spans the

Re: unicode as valid naming symbols

2014-03-28 Thread Ben Finney
Rustom Mody rustompm...@gmail.com writes: At least out here: - gnu-unifont does not cover things outside BMP That implies the GNU Unifont contains no characters from outside the BMP, which is untrue. Rather, the GNU Unifont's claim to fame is that it covers all characters in the BMP. But it

Re: unicode as valid naming symbols

2014-03-27 Thread Antoon Pardon
On 26-03-14 17:37, Ian Kelly wrote: On Wed, Mar 26, 2014 at 2:52 AM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Of course we don't have to follow mathematical convention with python. However allowing any unicode symbol as an identifier doesn't prohibit from using √ as an operator.

Re: unicode as valid naming symbols

2014-03-27 Thread Rustom Mody
On Thursday, March 27, 2014 3:06:02 PM UTC+5:30, Antoon Pardon wrote: On 26-03-14 17:37, Ian Kelly wrote: On Wed, Mar 26, 2014 at 2:52 AM, Antoon Pardon Of course we don't have to follow mathematical convention with python. However allowing any unicode symbol as an identifier doesn't

Re: unicode as valid naming symbols

2014-03-27 Thread Tim Chase
On 2014-03-27 08:10, Rustom Mody wrote: I know, for such a reason I would love it if keywords would have been written like this: 헱헲헳 (using mathematical bold) instead of just like this: def (using plain latin letters). It would mean among other things we could just write operator.not

Re: unicode as valid naming symbols

2014-03-27 Thread Mark H Harris
On 3/25/14 6:58 PM, Steven D'Aprano wrote: To quote a great Spaniard: “You keep using that word, I do not think it means what you think it means.” In~con~theveable ! My name is Inigo Montoya, you killed my father, prepare to die... Do you think that the ability to

Re: unicode as valid naming symbols

2014-03-27 Thread Rustom Mody
On Thursday, March 27, 2014 8:58:51 PM UTC+5:30, Mark H. Harris wrote: On 3/25/14 6:58 PM, Steven D'Aprano wrote: To quote a great Spaniard: “You keep using that word, I do not think it means what you think it means.” In~con~theveable ! My name is Inigo Montoya, you

Re: unicode as valid naming symbols

2014-03-27 Thread Mark H Harris
On 3/27/14 10:51 AM, Rustom Mody wrote: Observe: Good ol infix -- x+y.. prefix (with paren) -- foo(x) prefix without -- ¬ x In case you thought alphanumerics had parens -- sin x Then theres postfix -- n! Inside fix -- nCr (Or if you prefer ⁿCᵣ ??) And outside fix -- mod -- |x| And Ive

Re: unicode as valid naming symbols

2014-03-27 Thread Ian Kelly
On Thu, Mar 27, 2014 at 9:28 AM, Mark H Harris harrismh...@gmail.com wrote: Do you think that the ability to write this would be an improvement? import ⌺ ⌚ = ⌺.╩░ ⑥ = 5*⌺.⋨⋩ ❹ = ⑥ - 1 ♅⚕⚛ = [⌺.✱✳**⌺.❇*❹{⠪|⌚.∣} for ⠪ in ⌺.⣚] ⌺.˘˜¨´՛՜(♅⚕⚛) Steven, you're killing me here; argument by

Re: unicode as valid naming symbols

2014-03-27 Thread Chris Angelico
On Fri, Mar 28, 2014 at 2:28 AM, Mark H Harris harrismh...@gmail.com wrote: No, any unicode character (except numerals) should be able to begin a name identifier. alt-l λ and alt-v √ should be valid first character name identifier symbols. What, even whitespace?? ChrisA --

Re: unicode as valid naming symbols

2014-03-27 Thread MRAB
On 2014-03-27 15:51, Rustom Mody wrote: On Thursday, March 27, 2014 8:58:51 PM UTC+5:30, Mark H. Harris wrote: On 3/25/14 6:58 PM, Steven D'Aprano wrote: To quote a great Spaniard: “You keep using that word, I do not think it means what you think it means.”

Re: unicode as valid naming symbols

2014-03-27 Thread Rustom Mody
On Thursday, March 27, 2014 9:52:40 PM UTC+5:30, Ian wrote: On Thu, Mar 27, 2014 at 9:28 AM, Mark H Harris wrote: Do you think that the ability to write this would be an improvement? import ⌺ ⌚ = ⌺.╩░ ⑥ = 5*⌺.⋨⋩ ❹ = ⑥ - 1 ♅⚕⚛ = [⌺.✱✳**⌺.❇*❹{⠪|⌚.∣} for ⠪ in ⌺.⣚] ⌺.˘˜¨´՛՜(♅⚕⚛)

Re: unicode as valid naming symbols

2014-03-27 Thread Rustom Mody
On Thursday, March 27, 2014 10:47:04 PM UTC+5:30, MRAB wrote: On 2014-03-27 15:51, Rustom Mody wrote: On Thursday, March 27, 2014 8:58:51 PM UTC+5:30, Mark H. Harris wrote: On 3/25/14 6:58 PM, Steven D'Aprano wrote: To quote a great Spaniard: “You keep using that word, I do not

Re: unicode as valid naming symbols

2014-03-27 Thread Gregory Ewing
Mark H Harris wrote: Good ol infix -- x+y.. prefix (with paren) -- foo(x) prefix without -- ¬ x In case you thought alphanumerics had parens -- sin x Then theres postfix -- n! Inside fix -- nCr (Or if you prefer ⁿCᵣ ??) And outside fix -- mod -- |x| And mismatched delimiters: [5, 7)

Re: unicode as valid naming symbols

2014-03-26 Thread Antoon Pardon
On 25-03-14 23:47, Ethan Furman wrote: On 03/25/2014 12:29 PM, Mark H Harris wrote: On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an underscore. λ is a classified as

Re: unicode as valid naming symbols

2014-03-26 Thread Antoon Pardon
On 26-03-14 03:56, MRAB wrote: On 2014-03-25 22:47, Ethan Furman wrote: On 03/25/2014 12:29 PM, Mark H Harris wrote: On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an

Re: unicode as valid naming symbols

2014-03-26 Thread Ian Kelly
On Wed, Mar 26, 2014 at 2:52 AM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: On 26-03-14 03:56, MRAB wrote: Or as a root operator, e.g. 3 √ x (the cube root of x). Personally I would think such an operator is too limited to include in a programming language. This kind of notation is

unicode as valid naming symbols

2014-03-25 Thread Mark H Harris
greetings, I would like to create a lamda as follows: √ = lambda n: sqrt(n) On my keyboard mapping the problem character is alt-v which produces the radical symbol. When trying to set the symbol as a name within the name-space gives a syntax error: from math import sqrt √ = lambda n:

Re: unicode as valid naming symbols

2014-03-25 Thread wxjmfauth
Le mardi 25 mars 2014 19:30:34 UTC+1, Mark H. Harris a écrit : greetings, I would like to create a lamda as follows: √ = lambda n: sqrt(n) On my keyboard mapping the problem character is alt-v which produces the radical symbol. When trying to set the symbol as a name within

Re: unicode as valid naming symbols

2014-03-25 Thread MRAB
On 2014-03-25 18:30, Mark H Harris wrote: greetings, I would like to create a lamda as follows: √ = lambda n: sqrt(n) On my keyboard mapping the problem character is alt-v which produces the radical symbol. When trying to set the symbol as a name within the name-space gives a syntax error:

Re: unicode as valid naming symbols

2014-03-25 Thread Mark H Harris
On 3/25/14 1:52 PM, wxjmfa...@gmail.com wrote: '√'.isidentifier() False 'λ'.isidentifier() True S.isidentifier() - bool Return True if S is a valid identifier according to the language definition. cf unicode.org doc Excellent, thanks! marcus --

Re: unicode as valid naming symbols

2014-03-25 Thread Mark H Harris
On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an underscore. λ is a classified as Lowercase_Letter. √ is classified as Math_Symbol. Thanks much! I'll note that

Re: unicode as valid naming symbols

2014-03-25 Thread Marko Rauhamaa
Mark H Harris harrismh...@gmail.com: Thanks much! I'll note that for improvements. Any unicode symbol (that is not a number) should be allowed as an identifier. I don't know if that's a good idea, but that's how it is in lisp/scheme. Thus, * and 1+ are normal identifiers in lisp and

Re: unicode as valid naming symbols

2014-03-25 Thread Ian Kelly
On Tue, Mar 25, 2014 at 1:29 PM, Mark H Harris harrismh...@gmail.com wrote: On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an underscore. λ is a classified as

Re: unicode as valid naming symbols

2014-03-25 Thread Skip Montanaro
On Tue, Mar 25, 2014 at 2:48 PM, Marko Rauhamaa ma...@pacujo.net wrote: I don't know if that's a good idea, but that's how it is in lisp/scheme. Thus, * and 1+ are normal identifiers in lisp and scheme. But parsing Lisp is pretty trivial. Skip --

Re: unicode as valid naming symbols

2014-03-25 Thread Tim Chase
On 2014-03-25 14:29, Mark H Harris wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an underscore. λ is a classified as Lowercase_Letter. √ is classified as Math_Symbol.

Re: unicode as valid naming symbols

2014-03-25 Thread Cameron Simpson
On 25Mar2014 21:48, Marko Rauhamaa ma...@pacujo.net wrote: Mark H Harris harrismh...@gmail.com: Thanks much! I'll note that for improvements. Any unicode symbol (that is not a number) should be allowed as an identifier. I don't know if that's a good idea, but that's how it is in

Re: unicode as valid naming symbols

2014-03-25 Thread Ethan Furman
On 03/25/2014 12:29 PM, Mark H Harris wrote: On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an underscore. λ is a classified as Lowercase_Letter. √ is classified as

Re: unicode as valid naming symbols

2014-03-25 Thread Steven D'Aprano
On Tue, 25 Mar 2014 14:29:06 -0500, Mark H Harris wrote: On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an underscore. λ is a classified as

Re: unicode as valid naming symbols

2014-03-25 Thread Rustom Mody
On Wednesday, March 26, 2014 12:22:40 AM UTC+5:30, wxjm...@gmail.com wrote: Le mardi 25 mars 2014 19:30:34 UTC+1, Mark H. Harris a écrit : greetings, I would like to create a lamda as follows: √ = lambda n: sqrt(n) On my keyboard mapping the problem character is alt-v which produces the

Re: unicode as valid naming symbols

2014-03-25 Thread Terry Reedy
On 3/25/2014 2:30 PM, Mark H Harris wrote: greetings, I would like to create a lamda as follows: A lambda is a function lacking a proper name. √ = lambda n: sqrt(n) This is discouraged in PEP8. If the following worked, def √(n): return sqrt(n) would have √ as its __name__ attribute --

Re: unicode as valid naming symbols

2014-03-25 Thread MRAB
On 2014-03-25 22:47, Ethan Furman wrote: On 03/25/2014 12:29 PM, Mark H Harris wrote: On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an underscore. λ is a classified as

Re: unicode as valid naming symbols

2014-03-25 Thread Chris Angelico
On Wed, Mar 26, 2014 at 1:56 PM, MRAB pyt...@mrabarnett.plus.com wrote: No, it shouldn't. Doing so would mean we could not use √ as the square root operator in the future. Or as a root operator, e.g. 3 √ x (the cube root of x). Or both! It could be like unary negation and binary subtraction.