From ripley at stats.ox.ac.uk  Thu Dec 21 09:51:31 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 21 Dec 2006 08:51:31 +0000 (GMT)
Subject: [Rd] R windows crash (PR#9426)
In-Reply-To: <458A45E6.3050202@biostat.ku.dk>
References: <20061220235740.D29D029D3C@slim.kubism.ku.dk>
	<458A45E6.3050202@biostat.ku.dk>
Message-ID: <Pine.LNX.4.64.0612210847090.31846@gannet.stats.ox.ac.uk>

On Thu, 21 Dec 2006, Peter Dalgaard wrote:

[...]

> This seems reproducible on  Linux, except that it goes into an infinite
> loop. The lm call seems to be the real culprit:
>
> > testfun <- function(aa=aa) return(aa)
> > testfun()
> Error in testfun() : recursive default argument reference
> > testfun <- function(aa=aa) lm(x~y,data=aa)
> > testfun()
> (*poof*)

The difference is in argument evaluation between closures and internal 
functions (c() in my example, return() in yours).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] R windows crash (PR#9426)
Prof Brian Ripley