From murdoch.duncan at gmail.com  Sun Feb  7 22:22:32 2016
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Sun, 7 Feb 2016 16:22:32 -0500
Subject: [Rd] Assignment in environment
In-Reply-To: <1CDE0F5D-35D3-4315-AC08-7953DAD81914@gmail.com>
References: <1454850489.16166.0@physik.uni-freiburg.de>
	<56B74AC7.4010901@gmail.com>
	<1CDE0F5D-35D3-4315-AC08-7953DAD81914@gmail.com>
Message-ID: <56B7B598.4030409@gmail.com>

On 07/02/2016 9:15 AM, peter dalgaard wrote:
>
>> On 07 Feb 2016, at 14:46 , Duncan Murdoch <murdoch.duncan at gmail.com> wrot8[e:
>>
> [snippage]
>>
>> but in fact, this doesn't work:
>>
>> getValue(fn)[[1]] <- 3
>> Error in getValue(fn)[[1]] <- 3 : could not find function "getValue"
>>
>> I suspect this is a parser problem.
>
> Umm, no...
>
> The canonical semantics are that
>
> foo(x)[[....]] <- bar
>
> is internally converted to
>
> *tmp* <- foo(x)
> *tmp*[[....]] <- bar
> x <- `foo<-`(x, *tmp*)
>
> so both foo() and `foo<-` are required.
>

Yes, you're right.  I need more sleep.

Duncan Murdoch



[Rd] Assignment in environment
Duncan Murdoch