Skip to content
Prev 61449 / 63424 Next

Multiple Assignment built into the R Interpreter?

Thanks Gabriel and Kevin for your inputs,

regarding your points Gabriel, I think Python and Julia do allow multiple
sub-assignment, but in-line with my earlier suggestion in response to
Duncan to make multiple assignment an environment-level operation (like
collapse::%=% currently works),  this would not be possible in R.

Regarding the [a] <- coolest_function() syntax, yeah it would mean do
multiple assignment and set a equal to the first element dropping all other
elements. Multiple assignment should be positional loke in other languages,
enabling flexible renaming of objects on the fly. So it should be
irrelevant whether the function returns a named or unnamed list or vector.

Thanks also Kevin for this contribution. I think it?s a remarkable effort,
and I wouldn?t mind such semantics e.g. making it a function call to ?.[?
or any other one-letter function, as long as it?s coded in C and recognized
by the interpreter as an assignment operation.

Best regards,

Sebastian
On Sun 12. Mar 2023 at 01:00, Kevin Ushey <kevinushey at gmail.com> wrote:

            

  
  

Thread (22 messages)

Sebastian Martin Krantz Multiple Assignment built into the R Interpreter? Mar 11 Duncan Murdoch Multiple Assignment built into the R Interpreter? Mar 11 Sebastian Martin Krantz Multiple Assignment built into the R Interpreter? Mar 11 Duncan Murdoch Multiple Assignment built into the R Interpreter? Mar 11 Ivan Krylov Multiple Assignment built into the R Interpreter? Mar 11 Duncan Murdoch Multiple Assignment built into the R Interpreter? Mar 11 Sebastian Martin Krantz Multiple Assignment built into the R Interpreter? Mar 11 Duncan Murdoch Multiple Assignment built into the R Interpreter? Mar 11 Duncan Murdoch Multiple Assignment built into the R Interpreter? Mar 11 Gabriel Becker Multiple Assignment built into the R Interpreter? Mar 11 Kevin Ushey Multiple Assignment built into the R Interpreter? Mar 11 @vi@e@gross m@iii@g oii gm@ii@com Multiple Assignment built into the R Interpreter? Mar 11 Sebastian Martin Krantz Multiple Assignment built into the R Interpreter? Mar 11 Duncan Murdoch Multiple Assignment built into the R Interpreter? Mar 12 Sebastian Martin Krantz Multiple Assignment built into the R Interpreter? Mar 12 Duncan Murdoch Multiple Assignment built into the R Interpreter? Mar 12 Sebastian Martin Krantz Multiple Assignment built into the R Interpreter? Mar 12 Pavel Krivitsky Multiple Assignment built into the R Interpreter? Mar 12 Duncan Murdoch Multiple Assignment built into the R Interpreter? Mar 13 Gabor Grothendieck Multiple Assignment built into the R Interpreter? Mar 13 Martin Maechler Multiple Assignment built into the R Interpreter? Mar 14 Duncan Murdoch Multiple Assignment built into the R Interpreter? Mar 14