All I suggested was that × -- which has been the mathematical
standard for 400 years -- should be accepted as a synonym for * in
precisely the same way that ** is a synonym for ^ . It would be purely
a lexical matter.  I have maintained several compilers over the years,
and this is just about the easiest possible change one can make.  The
rest of the compiler never knows anything about it.  I have yet to see
a truly serious argument against it.

And that's odd, because think of the thread this is in!  Surely it was
obvious that I was half trolling?  I was responding to a demand from
someone that ** -- which has been used for decades for exponentiation
in those mainstream languages that  *have* an exponentiation operator,
INCLUDING R's MAIN RIVAL, PYTHON, since 70+ years ago.
Crack open any book on "<Whizzy> for Data Science" and it's likely to
be C# (no operator), F# (**), R (^ or **), or Python (** only; ^ is
xor).  If it's <Whizzy> for Data Analysis",
it might be SAS (**), GENSTAT (**), SPSS (** or ^), or R (** or ^).
SPSS didn't allow ^ when I used it because that was on an EBCDIC
machine that didn't include ^ in the character set.

If we want to talk about not making life any harder than we have to
for compiler writers, or for people coming to R from other systems
that do similar things, ** must continue to be supported.  And no,
despite ^ being based on a choice that made sense for just four years
60 years ago and now makes about as much sense as C's co-option of ^
for exclusive-OR -- a quirk continued in JavaScript, which uses ** for
exponentiation -- I am NOT suggesting that ^ should be withdrawn,
deprecated, or even sniggered at.  (OK, sniggering is OK.  But do it
sensitively and respectfully, where it can't hear you.)

I make a lot of mistakes when typing.  I wear out the backspace more
than the e.  Getting * and ** muddled up is one of the few mistakes
I've never made in programming.  (OK, for the happy week when I was
able to use APL I was using * when I meant ** all the time.  That was
me being stupid and trying to use APL as if it wasn't APL.  But
certainly never the other way around.)  It took me *years* to stop
typing 'begin' when I meant 'being', but that was from years of
writing more Algol than English.  My fault, not the fault of English
or Algol.  If only there'd been an AutoHotKey for Model 029 keypunches
(:-).Speaking of keypunches, does anyone else remember those forms you
wrote on for the keypunch operators to key in, with the little boxes
showing "here's how I write 0, O, 1, I, 2, Z"?  And how it didn't help
as much as you'd hope?

In short, my real message, which I mistakenly thought I was
emphasising with humorous exaggeration, was

   LET'S NOT MUCK AROUND WITH R SYNTAX ANY MORE


On Sun, 31 Aug 2025 at 01:23, <avi.e.gr...@gmail.com> wrote:
>
> Richard,
>
> As noted, we have had a history of computer languages using a very small 
> number of symbols to do too many things. A few languages like APL sort of 
> created new symbols by overwriting. Some simply used functions rather than 
> symbols. And, I note languages like C used asterisk to mean very different 
> things like following a pointer in concise but not trivial code as in how to 
> copy a null terminated character string:
>
> while (*p++ = *q++)
>
> If you had a pointer to a pointer to a pointer to a pointer, you could see 
> code with many stars and often many parentheses.
>
> As for your suggestion, I think you need to consider the people who have to 
> create a compiler or interpreter to handle the requirements. I am sure it is 
> doable in some ways but I suggest care. Many languages accept octal or 
> hexadecimal notation and thus a number like 2A is allowed but since this can 
> lead to ambiguous situations, often a x must be prepended as a sort of 
> special case. In such a language, you might not want to use x or X OR you may 
> insist on whitespace around it as compared to other operators that need nonw. 
> And, need I say that x is a very common variable name.
>
> Back to R, it is what it is and if someone designs yet another new language 
> in x decades, who knows what they will come up with that may be hodgepodge of 
> features and ways from R and python and ... and will have so many features 
> and ways that no one person or group knows it all as it will include use of 
> thousands of symbols from something like UNICODE.
>
> For now, if we use R, we have what we have and we will make mistakes. Anyone 
> here think there can be problems if someone creates read_csv() as their 
> version of read.csv() and some people use the wrong one, ...?
>
>
>
>
> -----Original Message-----
> From: R-help <r-help-boun...@r-project.org> On Behalf Of Richard O'Keefe
> Sent: Saturday, August 30, 2025 3:09 AM
> To: Leo Mada <leo.m...@syonic.eu>
> Cc: Leo Mada via R-help <r-help@r-project.org>
> Subject: Re: [R] The "**" exponentiation operator.
>
> I did mathematics up to University level and finally petered out at
> Category Theory, which I never got the hang of.
> Here's the fun: I *never* saw the asterisk used for multiplication in
> my mathematics or physics courses.
> And I never saw any operator at all used for exponentiation.
> Asterisk was a superscript operator for conjugation or duals.  Had
> nothing to do with products.
>
> Fortran COBOL, and PL/I used. and still use, * for multiplication and
> ** for exponentiation.
> APL used × for multiplication and * for exponentiation.
>
> Could I recommend that R allow × as a synonym for * ?  It has been the
> mathematical sign for
> multiplication for >400 years, when a sign is used, and it's been
> available on computers for decades.
>
> On Sat, 30 Aug 2025 at 03:05, Leo Mada via R-help <r-help@r-project.org> 
> wrote:
> >
> > Dear Rolf,
> >
> > I join this discussion a little bit late.
> >
> > Indeed, the '**' operator is a very poor choice for exponentiation. I can 
> > give some examples to justify my claim. Notice that '**' and '*' would 
> > almost always get mixed in real mathematics.
> >
> > Fortunately, I am used to "^"; otherwise, I would have had a very hard time 
> > to  debug the *monster*:
> > https://github.com/discoleo/R/blob/master/Math/Poly.System.S5.Ht.Formulas.Derivation.Coeffs.R
> >
> > Those are the coefficients of a polynomial of order 7 (see below for 
> > further information). And I have plenty of examples.
> >
> > Unfortunately, some "programming" languages mix '*' and '**'; which makes 
> > any work with polynomials a nightmare!
> >
> > I "found" something on this topic - hope everyone gets a little bit amused:
> > https://github.com/discoleo/R/blob/master/Math.NewTerminology.wiki
> >
> > Sincerely,
> >
> > Leonard
> >
> > ===========
> > Regarding the *Monster*:
> >
> > It enables to solve a particular system with 5 variables with cyclic 
> > symmetry:
> > x1+x2+x3+x4+x5 = R1
> > # Note: this is NOT the full E2
> > x1*x2+x2*x3+x3*x4+x4*x5+x5*x1 = R2
> > E3 = R3
> > E4 = R4
> > E5 (= x1*x2*x3*x4*x5) = R5;
> >
> > This system can be transformed into a system that can be solved using a 
> > polynomial of lower order than the original system.
> >
> > Unfortunately, I do not have a methemtical theory yet for the Ht5 System. I 
> > worked it out the hard way; it is almost finished, but I did not have any 
> > more time during the last 2 years.
> >
> > For some (very) basic details, see:
> > https://github.com/discoleo/R/blob/master/Math/Poly.System.md
> >
> > Again, I did not have time to write anything more thoroughly.
> >
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide 
> > https://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to