Hacker News new | ask | show | jobs
by kgwgk 2017 days ago
I know what formulas are, I just don’t see what’s the connection with the proposed change:

     ‘\(x) x + 1’ is parsed as ‘function(x) x + 1’
I also know that R has some vestigial scheme under the hood, but the syntax is not lisp (it was taken from S). In common lisp one could easily use a macro or reader macro but in R a change in the parser is needed so “\” can be used instead of “function”.

Note that the existing “f <- function(...) ...” syntax is not being removed. But I write a lot of code like

    state.range <- apply(state.x77, 2, function(x) c(min(x), median(x), max(x)))
and it will be an improvement to be able to condense it a bit to

    state.range <- apply(state.x77, 2, \(x) c(min(x), median(x), max(x)))