[Rd] order of operations

2021-08-27 Thread Gabor Grothendieck
Are there any guarantees of whether x will equal 1 or 2 after this is run? (x <- 1) * (x <- 2) ## [1] 2 x ## [1] 2 -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com __ R-devel@r-p

Re: [Rd] order of operations

2021-08-27 Thread Thierry Onkelinx via R-devel
IMHO this is just bad practice. Whether the result is guaranteed or not, doesn't matter. ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Te

Re: [Rd] order of operations

2021-08-27 Thread Gabor Grothendieck
I agree and personally never do this but I would still like to know if it is guaranteed behavior or not. On Fri, Aug 27, 2021 at 11:28 AM Thierry Onkelinx wrote: > IMHO this is just bad practice. Whether the result is guaranteed or not, > doesn't matter. > > ir. Thierry Onkelinx > Statisticus /

Re: [Rd] order of operations

2021-08-27 Thread Avi Gross via R-devel
omputer languages and adding ever more features, with greater power comes greater responsibility and often greater confusion. -Original Message- From: R-devel On Behalf Of Gabor Grothendieck Sent: Friday, August 27, 2021 11:32 AM To: Thierry Onkelinx Cc: r-devel@r-project.org Subject: Re: [

Re: [Rd] order of operations

2021-08-27 Thread Gabor Grothendieck
t guaranteed should be > flagged by the language at compile time (or when interpreted) and refuse to > go on. > > All I can say with computer languages and adding ever more features, > with greater power comes greater responsibility and often greater > confusion. > > >

Re: [Rd] order of operations

2021-08-27 Thread Avi Gross via R-devel
c: r-devel@r-project.org Subject: Re: [Rd] order of operations It could be that the two sides of * are run in parallel in the future and maybe not having a guarantee would simplify implementation? On Fri, Aug 27, 2021 at 12:35 PM Avi Gross via R-devel wrote: > > Does anyone have a

Re: [Rd] order of operations

2021-08-27 Thread GILLIBERT, Andre
_ De : R-devel de la part de Gabor Grothendieck Envoy� : vendredi 27 ao�t 2021 19:57:33 � : Avi Gross Cc : r-devel@r-project.org Objet : Re: [Rd] order of operations ATTENTION: Cet e-mail provient d�une adresse mail ext�rieure au CHU de Rouen. Ne cliquez pas sur les liens ou

Re: [Rd] order of operations

2021-08-27 Thread Enrico Schumann
On Fri, 27 Aug 2021, Gabor Grothendieck writes: > Are there any guarantees of whether x will equal 1 or 2 after this is run? > > (x <- 1) * (x <- 2) > ## [1] 2 > x > ## [1] 2 At least the "R Language Definition" [1] says "The exponentiation operator ‘^’ and the left assignment plus minus op

Re: [Rd] order of operations

2021-08-27 Thread Duncan Murdoch
On 27/08/2021 3:06 p.m., Enrico Schumann wrote: On Fri, 27 Aug 2021, Gabor Grothendieck writes: Are there any guarantees of whether x will equal 1 or 2 after this is run? (x <- 1) * (x <- 2) ## [1] 2 x ## [1] 2 At least the "R Language Definition" [1] says "The exponentiation operator ‘^

Re: [Rd] order of operations

2021-08-28 Thread peter dalgaard
Yes, and were it not for 0 * NA == NA, you might skip evaluation of y if x evaluates to zero. In Andre Gillibert's example: 1 | (alpha<-6) there really is no reason to evaluate the assignment since (1 | any) is always TRUE. Notwithstanding method dispatch, that is. With general function call

Re: [Rd] order of operations

2021-08-28 Thread GILLIBERT, Andre
Duncan Murdoch Cc : r-devel@r-project.org Objet : Re: [Rd] order of operations ATTENTION: Cet e-mail provient d�une adresse mail ext�rieure au CHU de Rouen. Ne cliquez pas sur les liens ou n'ouvrez pas les pi�ces jointes � moins de conna�tre l'exp�diteur et de savoir que le contenu est s�r. En ca

Re: [Rd] order of operations

2021-08-28 Thread Duncan Murdoch
t all its arguments are evaluated. -- Sincerely Andre GILLIBERT *De :* R-devel de la part de peter dalgaard *Envoyé :* samedi 28 août 2021 09:26:03 *À :* Duncan Murdoch *Cc :* r-devel@r-project.org *Objet :* Re: [Rd] order of operations ATTENTION: Cet e-mail provient d’une ad

Re: [Rd] order of operations

2021-08-31 Thread Greg Minshall
Gabor Grothendieck wrote: > ... and maybe not having a guarantee would simplify implementation? +1 for: "The results of such statements are not defined.", or something to that effect. (Erasmus had something to say here. :) __ R-devel@r-project.org ma