[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Greg Ewing
Abe Dillon wrote: Why not use a more consistent notation like add(x, y) instead of x + y when we know addition is a function and all other functions (usually) follow the f(x, y) notation? Because math is old. No, it's because infix notation is *more readable* than function notation when formu

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Greg Ewing
Mike Miller wrote: There is: U+2B32 ⬲ LEFT ARROW WITH CIRCLED PLUS But there would need to be more. At this point you're creating a mini-language by combining symbols, which the OP seems to be against, since he describes things like ":=" and "<-" condescendingly as "ascii soup". -

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Abe Dillon
> > In that context something like the Conway Game of Life in APL demo should > inspire an interested party in exploring further. None of the tools he > uses in the demo are difficult to comprehend, particularly if you have a > background in basic Linear Algebra (another foundational element of AP

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Chris Angelico
On Thu, Nov 7, 2019 at 12:35 PM Martin Euredjian via Python-ideas wrote: > >> Another example of ASCII soup is regex. > > That's interesting, I feel the same way. I can read most code pretty > > quickly, but as soon as I hit a regex it takes me 50x as long to read > > That's it! You got it! The

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Martin Euredjian via Python-ideas
> This distinction between notation and soup seems pretty subjective. Yes and no.  Math looks like hieroglyphics to most people.  We are talking about professional programmers here.  In that context something like the Conway Game of Life in APL demo should inspire an interested party in explorin

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Andrew Barnert via Python-ideas
On Nov 7, 2019, at 01:04, Martin Euredjian via Python-ideas wrote: > > >> No professional thinks that "a = some_object" results in a bucket being > >> filled with whatever the object might contain. > > That's exactly how variables work in many common languages like C > > Nope, not true. Byte

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Chris Angelico
On Thu, Nov 7, 2019 at 11:15 AM Martin Euredjian via Python-ideas wrote: > Anyhow, I'll repeat, I am nobody and I am certainly not going to change the > Python world. Sleep well knowing this is just another random moron saying > something he probably should not have said. > You keep saying tha

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Abe Dillon
> > Nope, not true. Yes indeed. It is true. Bytes, words, integers and that's about it. All the primary data types and structs and enums and typedefs. That leaves pointers, arrays, and... function pointers if you don't count those as pointers. All of which misses the point completely. In C, y

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Abe Dillon
> > > The fact that I can enter Python code as plain text is even more useful > than music and math. > Sure, because you speak English. Go talk to a kid who has to learn this > in, I don't know, Egypt or China. The same process that made mathematical notation standard across the world is happeni

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Alexandre Brault
On 2019-11-06 12:05 p.m., Martin Euredjian via Python-ideas wrote: Typing these symbols isn't a problem at all.  For example, in NARS2000, a free APL interpreter I use, the assignment operator "←" is entered simply with "Alt + [".  It takes seconds to internalize this and never think about it

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Martin Euredjian via Python-ideas
> Really? Because I’ve been using ABC notation for music for decades Try writing an orchestral suite in ASCII and see how well it goes.  C'mon.  I know people use tablature and similar ideas.  Sure.  So what? > The fact that I can enter Python code as plain text is even more useful than > music

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Abe Dillon
> > No, using "<--" is going in the wrong direction. We want notation, not > ASCII soup. This distinction between notation and soup seems pretty subjective. What is the difference between soup and notation? In my mind it has a lot to do with familiarity. I watched that video about programming Con

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Andrew Barnert via Python-ideas
On Nov 6, 2019, at 21:53, Martin Euredjian via Python-ideas wrote: > > I've had this kind of a conversation with many people in the 30+ years since > I learned APL and 20+ years since I stopped using it professionally. It has > been my experience that people who have not had the experience ra

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Martin Euredjian via Python-ideas
>> No professional thinks that "a = some_object" results in a bucket being >>filled with whatever the object might contain. > That's exactly how >>variables work in many common languages like C Nope, not true.  Bytes, words, integers and that's about it.  Anything else is a pointer to a relev

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Andrew Barnert via Python-ideas
On Nov 6, 2019, at 19:52, Mike Miller wrote: > >> On 2019-11-06 05:40, Andrew Barnert via Python-ideas wrote: >> While we’re at it, when you replace both = and := with an arrow, what do you >> do with += and the other augmented assignments? I can’t think of a >> single-character symbol that vis

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Chris Angelico
On Thu, Nov 7, 2019 at 8:47 AM Greg Ewing wrote: > > Andrew Barnert via Python-ideas wrote: > > On Nov 6, 2019, at 08:59, Chris Angelico wrote: > > > >> No, because "x <-- y" is already legal syntax > > > > You could handle that by making the grammar more complicated. > > Or just have the tokenis

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Abe Dillon
> > Question: Where did APL's "←" operator come from? > Doesn't matter. If your notation can't stand on its own without a history lesson, then it's not great. > A number of APL's elements came from a notation developed to describe the > operation of IBM processors back in the 1960's. In many w

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Greg Ewing
Andrew Barnert via Python-ideas wrote: On Nov 6, 2019, at 08:59, Chris Angelico wrote: No, because "x <-- y" is already legal syntax You could handle that by making the grammar more complicated. Or just have the tokeniser treat "<--" as a single token, the same way that it treats "<=" as a

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Chris Angelico
On Thu, Nov 7, 2019 at 7:21 AM Abe Dillon wrote: >> None of your objections ring true. A simple example is had from >> mathematics. The integral symbol conveys and represents a concept. Once >> the practitioner is introduced to the definition of that symbol, what it >> means, he or she uses

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Martin Euredjian via Python-ideas
> I don't think you understood the point about APL's arrow assignment operator >being counterintuitive in Python. I understood this just fine.  I happen to think your argument in this regard is neither sound nor valid. Question:  Where did APL's  "←" operator come from? A number of APL's elem

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Abe Dillon
> > I used APL professionally for about ten years. Yes, you've stated that already. None of your objections ring true. A simple example is had from > mathematics. The integral symbol conveys and represents a concept. Once > the practitioner is introduced to the definition of that symbol, what

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Chris Angelico
On Thu, Nov 7, 2019 at 4:05 AM Martin Euredjian via Python-ideas wrote: > I used APL professionally for about ten years. None of your objections ring > true. A simple example is had from mathematics. The integral symbol conveys > and represents a concept. Once the practitioner is introduced

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread David Mertz
Unfortunately, my device dors not display LEFT ARROW WITH CIRCLED PLUS. Nor, obviously, write I have any way to enter it easily. On Wed, Nov 6, 2019, 2:05 PM Mike Miller wrote: > > On 2019-11-06 05:40, Andrew Barnert via Python-ideas wrote: > > While we’re at it, when you replace both = and := w

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Mike Miller
On 2019-11-06 05:40, Andrew Barnert via Python-ideas wrote: While we’re at it, when you replace both = and := with an arrow, what do you do with += and the other augmented assignments? I can’t think of a single-character symbol that visually represents that meaning. If you leave it as + follo

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Mike Miller
It's too late for this one, but I'd be open to allowing Unicode operators. It is always poo-poo'd here but there are numerous input solutions: - I enabled AltGr and a Compose key on my US keyboard, I can type symbols like ©, —, …, ø, ə, with two or three keystrokes, diacritics too: café. I

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Martin Euredjian via Python-ideas
Thanks for your feedback.  A few comments: > I do not consider these two things conceptually equivalent. In Python the >identifier ('a' in this case) is just label to the value I used APL professionally for about ten years.  None of your objections ring true.  A simple example is had from mathem

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Andrew Barnert via Python-ideas
On Nov 6, 2019, at 08:59, Chris Angelico wrote: > > No, because "x <-- y" is already legal syntax (it applies unary minus > to y twice, then checks whether x is less than the result). You could handle that by making the grammar more complicated. I don’t think it’s a good idea at all, but I thin

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Andrew Barnert via Python-ideas
On Nov 6, 2019, at 01:46, martin_05--- via Python-ideas wrote: > > > Still, the idea of two assignment operators just didn't sit well with me. > That's when I realized I had seen this kind of a problem nearly thirty years > ago, with the introduction of "J". I won't get into the details unles

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Chris Angelico
On Wed, Nov 6, 2019 at 6:57 PM Richard Musil wrote: > Second point, I can write := in two keystrokes, but I do not have a dedicated > key for the arrow on my keyboard. Should '<--' also be an acceptable syntax? No, because "x <-- y" is already legal syntax (it applies unary minus to y twice, the