Hi,

On Tue, Dec 16, 2008 at 9:13 AM, Wacek Kusnierczyk <
Waclaw.Marcin.Kusnierczyk@idi.ntnu.no> wrote:

> ... but this is also legal if you really hate <- :
>
> foo({x = 2})
> # assign to x, pass to foo as a
>

This is legal but doesn't do what you probably expect -- although
documentation for `<-` says the value (returned by <-) is 'value' i.e.
whatever is on the right side ...

> x<-NULL  # just to make sure it's not yet 42
> foo <- function(a) a
> foo({x = 42})   # no result
> x
[1] 42

If you really hate <-, you should do either
foo({(x=42)})   # or ....
foo({x=42; x})  # or even ...
foo(a=force(x=43))

As for = being more intuitive, my favorite example is x=x+1 (how on earth
can x equal x+1 ??? ... wait, this is an assignment д#зг$@{{!!!).

KK

	[[alternative HTML version deleted]]

