search for: right_assign

Displaying 14 results from an estimated 14 matches for "right_assign".

2013 Jul 05
3
should the text for RIGHT_ASSIGN be -> in getParseData()?
...(parse(text='1->x')) line1 col1 line2 col2 id parent token terminal text 7 1 1 1 4 7 0 expr FALSE 1 1 1 1 1 1 2 NUM_CONST TRUE 1 2 1 1 1 1 2 7 expr FALSE 3 1 2 1 3 3 7 RIGHT_ASSIGN TRUE <- 4 1 4 1 4 4 6 SYMBOL TRUE x 6 1 4 1 4 6 7 expr FALSE Is that expected? > sessionInfo() R version 3.0.1 (2013-05-16) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3]...
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
...emantics (including the corner cases, some of which you have > already mentioned). I'm not sure I'm up to the task. > If I were doing it, here's what I'd propose: '[' formlist ']' LEFT_ASSIGN expr '[' formlist ']' EQ_ASSIGN expr expr RIGHT_ASSIGN '[' formlist ']' where `formlist` has the syntax of the formals list for a function definition. This would have the following semantics: { *tmp* <- expr # For arguments with no "default" expression, argname1 <- *tmp*[[1]] argname2 &...
2023 Mar 11
3
Multiple Assignment built into the R Interpreter?
...some of which you have > > already mentioned). I'm not sure I'm up to the task. > > > > If I were doing it, here's what I'd propose: > > '[' formlist ']' LEFT_ASSIGN expr > '[' formlist ']' EQ_ASSIGN expr > expr RIGHT_ASSIGN '[' formlist ']' > > where `formlist` has the syntax of the formals list for a function > definition. This would have the following semantics: > > { > *tmp* <- expr > > # For arguments with no "default" expression, > >...
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
...> already mentioned). I'm not sure I'm up to the task. > > > > If I were doing it, here's what I'd propose: > > ? ?'[' formlist ']' LEFT_ASSIGN expr > ? ?'[' formlist ']' EQ_ASSIGN expr > ? ?expr RIGHT_ASSIGN? '[' formlist ']' > > where `formlist` has the syntax of the formals list for a function > definition.? This would have the following semantics: > > ? ? { > ? ? ? *tmp* <- expr > > ? ? ? # For arguments with no "default"...
2023 Mar 11
2
Multiple Assignment built into the R Interpreter?
...;m not sure I'm up to the task. > > > > > > > If I were doing it, here's what I'd propose: > > > > '[' formlist ']' LEFT_ASSIGN expr > > '[' formlist ']' EQ_ASSIGN expr > > expr RIGHT_ASSIGN '[' formlist ']' > > > > where `formlist` has the syntax of the formals list for a function > > definition. This would have the following semantics: > > > > { > > *tmp* <- expr > > > > # For...
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
On Sat, 11 Mar 2023 11:11:06 -0500 Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > That's clear, but your proposal violates a very basic property of the > language, i.e. that all statements are expressions and have a value. How about reframing this feature request from multiple assignment (which does go contrary to "everything has only one value, even if it's
2023 Mar 12
2
Multiple Assignment built into the R Interpreter?
...> > > > > > > > > > If I were doing it, here's what I'd propose: > > > > > > '[' formlist ']' LEFT_ASSIGN expr > > > '[' formlist ']' EQ_ASSIGN expr > > > expr RIGHT_ASSIGN '[' formlist ']' > > > > > > where `formlist` has the syntax of the formals list for a function > > > definition. This would have the following semantics: > > > > > > { > > > *tmp* <- expr > &g...
2023 Mar 11
1
Multiple Assignment built into the R Interpreter?
...lready mentioned). I'm not sure I'm up to the task. > > > > > > > If I were doing it, here's what I'd propose: > > > > '[' formlist ']' LEFT_ASSIGN expr > > '[' formlist ']' EQ_ASSIGN expr > > expr RIGHT_ASSIGN '[' formlist ']' > > > > where `formlist` has the syntax of the formals list for a function > > definition. This would have the following semantics: > > > > { > > *tmp* <- expr > > > > # For arguments with no &quot...
2023 Mar 12
1
Multiple Assignment built into the R Interpreter?
...> >? ? ?If I were doing it, here's what I'd propose: > > > > > >? ? ? ? ?'[' formlist ']' LEFT_ASSIGN expr > > >? ? ? ? ?'[' formlist ']' EQ_ASSIGN expr > > >? ? ? ? ?expr RIGHT_ASSIGN? '[' formlist ']' > > > > > >? ? ?where `formlist` has the syntax of the formals list for > a function > > >? ? ?definition.? This would have the following semantics: > > > > > >? ?...
2020 Apr 13
3
detect ->
Adrian, Indeed, this has come up in a few places, but as Gabor says, there is no such thing as right hand assignment at any point after parsing is complete. This means the only feasible way to detect it, which a few projects do I believe, is process the code while it is still raw text, before it goes into the parser, and have clever enough regular expressions. The next question, then, is why
2024 Mar 04
1
[External] Re: capture "->"
Maybe someone has already suggested this, but if your functions accepted strings you could use sub or gsub to replace the -> with a symbol that parsed at the same precedence as <-, say <<-. Then parse it and deal with it. When it is time to display the parsed and perhaps manipulated formulae to the user, deparse it and do the reverse replacement. > encode <-
2023 Mar 12
1
Multiple Assignment built into the R Interpreter?
...If I were doing it, here's what I'd propose: > > > > > > > > '[' formlist ']' LEFT_ASSIGN expr > > > > '[' formlist ']' EQ_ASSIGN expr > > > > expr RIGHT_ASSIGN '[' formlist ']' > > > > > > > > where `formlist` has the syntax of the formals list for > > a function > > > > definition. This would have the following semantics: > > > > &g...
2023 Mar 13
1
Multiple Assignment built into the R Interpreter?
...it, here's what I'd propose: > > > ???????? > > > > > ???????? > >???????? '[' formlist ']' LEFT_ASSIGN expr > > > ???????? > >???????? '[' formlist ']' EQ_ASSIGN expr > > > ???????? > >???????? expr RIGHT_ASSIGN? '[' formlist ']' > > > ???????? > > > > > ???????? > >???? where `formlist` has the syntax of the formals > > > list for > > > ??????? a function > > > ???????? > >???? definition.? This would have the following > &g...
2023 Mar 13
1
Multiple Assignment built into the R Interpreter?
...;s what I'd propose: >>>> ???????? > > >>>> ???????? > >???????? '[' formlist ']' LEFT_ASSIGN expr >>>> ???????? > >???????? '[' formlist ']' EQ_ASSIGN expr >>>> ???????? > >???????? expr RIGHT_ASSIGN? '[' formlist ']' >>>> ???????? > > >>>> ???????? > >???? where `formlist` has the syntax of the formals >>>> list for >>>> ??????? a function >>>> ???????? > >???? definition.? This would have the fol...