Message-ID: <f8e6ff050809261505y74b1b878kfce544f51e3563fe@mail.gmail.com>
Date: 2008-09-26T22:05:01Z
From: Hadley Wickham
Subject: Return a list
In-Reply-To: <48DD5A3B.6080505@idi.ntnu.no>
> it depends on what the original author wanted.
>
> with constructs a new environment, and all assignments, if any, made in
> the expression evaluated within with are invisible to the outside
> (unless one plays with environments, again):
>
> x = 1:10
> a = 3
> with(test(), { x[1:3] = c(a,b,c); x = x+d; a = a + 1 })
> x # still 1:10, whatever test returns
> a # still 3. whatever test returns
>
> if the author wanted the values included in the list to be visible and
> accessible by simple names, and used in assignments in a larger part of
> code, using with might be inconvenient.
What about within ?
Hadley
--
http://had.co.nz/