On Sat, 11 Mar 2023 11:11:06 -0500 Duncan Murdoch <murdoch.dun...@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 sometimes invisible(NULL)") to "structured binding" / "destructuring assignment" [*], which takes this single single value returned by the expression and subsets it subject to certain rules? It may be easier to make a decision on the semantics for destructuring assignment (e.g. languages which have this feature typically allow throwing unneeded parts of the return value away), and it doesn't seem to break as much of the rest of the language if implemented. I see you've already mentioned it ("JavaScript-like"). I think it would fulfil Sebastian's requirements too, as long as it is considered "true assignment" by the rest of the language. The hard part is to propose the actual grammar of the new feature (in terms of src/main/gram.y, preferably without introducing conflicts) and its semantics (including the corner cases, some of which you have already mentioned). I'm not sure I'm up to the task. -- Best regards, Ivan [*] https://en.cppreference.com/w/cpp/language/structured_binding https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel