I am not personally for or against changes to the R main language but do find
that too many people keep wanting to change R so it should be like some other
language. Many features would be nice, especially if they do not break existing
code, but the time and effort and other overheads need to be
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/kevinushey/dotty
The package exports an object called `.`, with a special `[<-.dot` S3
method which
There are some other considerations too (apologies if these were mentioned
above and I missed them). Also below are initial thoughts, so apologies for
any mistakes or oversights.
For example, if
[a, b] <- my2valuefun()
works the same as
local({
tmp <- my2valuefun()
stopifnot(is.list(tmp) && len
On 11/03/2023 4:42 p.m., Sebastian Martin Krantz wrote:
Thanks Duncan and Ivan for the careful thoughts. I'm not sure I can
follow all aspects you raised, but to give my limited take on a few:
your proposal violates a very basic property of the language, i.e. that all
statements are expressi
On 11/03/2023 4:42 p.m., Sebastian Martin Krantz wrote:
Thanks Duncan and Ivan for the careful thoughts. I'm not sure I can
follow all aspects you raised, but to give my limited take on a few:
your proposal violates a very basic property of the language, i.e. that all
statements are expressi
Thanks Duncan and Ivan for the careful thoughts. I'm not sure I can follow
all aspects you raised, but to give my limited take on a few:
> your proposal violates a very basic property of the language, i.e. that all
> statements are expressions and have a value.
> What's the value of 1 + (A, C =
On 11/03/2023 11:57 a.m., Ivan Krylov wrote:
On Sat, 11 Mar 2023 11:11:06 -0500
Duncan Murdoch 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 multi
On Sat, 11 Mar 2023 11:11:06 -0500
Duncan Murdoch 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 "
On 11/03/2023 9:54 a.m., Sebastian Martin Krantz wrote:
Thanks Duncan,
I know about list2env(), in fact a previous version of collapse::`%=%`
was coded as
"%=%" <- function(lhs, rhs) {
if(!is.character(lhs)) stop("lhs needs to be character")
if(!is.list(rhs)) rhs <- as.vector(rhs, "li
Thanks Duncan,
I know about list2env(), in fact a previous version of collapse::`%=%` was
coded as
"%=%" <- function(lhs, rhs) {
if(!is.character(lhs)) stop("lhs needs to be character")
if(!is.list(rhs)) rhs <- as.vector(rhs, "list")
if(length(lhs) != length(rhs)) stop("length(lhs) not e
I think the standard way to do this in R is given by list2env(), as
described in a couple of answers on the SO page you linked.
The syntax you proposed would be likely to be confusing in complex
expressions, e.g.
f(A, C, Q, R = init_matrices(X, Y, Z))
would obviously not work but wouldn't
Dear R Core,
working on my dynamic factor modelling package, which requires several
subroutines to create and update several system matrices, I come back to
the issue of being annoyed by R not supporting multiple assignment out of
the box like Matlab, Python and julia. e.g. something like
A, C, Q
12 matches
Mail list logo