Re: [Rd] Multiple Assignment built into the R Interpreter?

2023-03-12 Thread Pavel Krivitsky
Dear All, As a maintainer of large, complex packages, I can think of many places in which deconstructing assignment would simplify the code, as well as facilitate readability by breaking up larger functions into helpers, so I would be very glad to see this incorporated somehow. I think the crux o

Re: [Rd] Multiple Assignment built into the R Interpreter?

2023-03-12 Thread Sebastian Martin Krantz
Kevins package is very nice as a proof of concept, no doubt about that, but it is not at the level of performance or convenience that a native R implementation would offer. I would probably not use it to translate matlab routines into R packages placed on CRAN, because it’s an additional dependency

Re: [Rd] Multiple Assignment built into the R Interpreter?

2023-03-12 Thread Sebastian Martin Krantz
Thinking more about this, and seeing Kevins examples at https://github.com/kevinushey/dotty, I think this is the most R-like way of doing it, with an additional benefit as it would allow to introduce the useful data.table semantics DT[, .(a = b, c, d)] to more general R. So I would propose to intro

Re: [Rd] Multiple Assignment built into the R Interpreter?

2023-03-12 Thread Sebastian Martin Krantz
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 wo

Re: [Rd] Multiple Assignment built into the R Interpreter?

2023-03-12 Thread Duncan Murdoch
On 12/03/2023 6:07 a.m., Sebastian Martin Krantz wrote: Thinking more about this, and seeing Kevins examples at https://github.com/kevinushey/dotty , I think this is the most R-like way of doing it, with an additional benefit as it would allow to introduce t

Re: [Rd] Multiple Assignment built into the R Interpreter?

2023-03-12 Thread Duncan Murdoch
I really like it! Nicely done. Duncan Murdoch On 11/03/2023 6:00 p.m., Kevin Ushey wrote: FWIW, it's possible to get fairly close to your proposed semantics using the existing metaprogramming facilities in R. I put together a prototype package here to demonstrate: https://github.com/kev