From mmuurr at gmail.com  Thu Aug 15 17:33:07 2013
From: mmuurr at gmail.com (Murat Tasan)
Date: Thu, 15 Aug 2013 11:33:07 -0400
Subject: [Rd] local variable assignment: first copies from higher frame?
In-Reply-To: <CAJoaRhYuKyqxpHdqki0hHuDhZbXA32Xidy9myuLs6y5-gviJ2Q@mail.gmail.com>
References: <CA+YV+HzN5NEPyytEKkSBoj-Ca-wd5Sw=NRM1=g2oukZki53G0g@mail.gmail.com>
	<CAJoaRhYuKyqxpHdqki0hHuDhZbXA32Xidy9myuLs6y5-gviJ2Q@mail.gmail.com>
Message-ID: <CA+YV+HzpqUw7Ur94JxTtvnPWqLxVvCpO-wGwmEyY2dA4POb_FA@mail.gmail.com>

ah, that makes perfect sense in the functional programming sense of things.
thanks!

On Wed, Aug 14, 2013 at 10:19 PM, Peter Meilstrup
<peter.meilstrup at gmail.com> wrote:
> Not anything that complicated -- your answer is in the R language definition
> under 'Subset assignment' and the part in "Function calls" that describes
> assignment functions.
>
> Whenever a call is found on the left side of a `<-`, it is munged by
> sticking a "<-" on the function name and pulling out the first argument. So
>
> my_list$x <- x
>
> which is syntactically equivalent to
>
> `$`(my_list, x) <- x
>
> is effectively transformed into something like:
>
> my_list <- `$<-`(my_list, x, x)
>
> The function `$<-` gets its argument from wherever it is found, and returns
> a modified version.
>
> Peter



[Rd] local variable assignment: first copies from higher frame?
Murat Tasan