Johannes Huesing wrote:
Stavros Macrakis <[EMAIL PROTECTED]> [Wed, Dec 10, 2008 at 04:59:25AM CET]:
So I conclude that what is really meant by "R semantics are based on Scheme
semantics" is "R has functions as first-class citizens and a correct
implementation of lexical scope, including upwards funarg".
One other thing reminiscient of Lisp is the infix notation (as in "+"(1, 3)),
which the authors have sprinkled with enough syntactic sugar that the users
needn't be bothered with. To the benefit of ubiquity, I'd think.
That's prefix notation, infix is "1+3" (and postfix is "1,3,+" as in old
HP calculators). But you're right that R has Lisp-like parse trees with
a thin layer of syntactic sugar:
Lisp writes function calls as (f x y) for f(x,y) and (+ 1 3) for 1+3. In
R we have
> e <- quote(f(x,y))
> e[[1]];e[[2]]; e[[3]]
f
x
y
> e <- quote(1+3)
> e[[1]];e[[2]]; e[[3]]
`+`
[1] 1
[1] 3
--
O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.