From macrakis at alum.mit.edu  Mon Mar  9 23:31:40 2009
From: macrakis at alum.mit.edu (Stavros Macrakis)
Date: Mon, 9 Mar 2009 18:31:40 -0400
Subject: [Rd] E`<`<rrors in recursive default argument references
In-Reply-To: <49B58CB6.6030804@idi.ntnu.no>
References: <8b356f880903091213o33e27e8di878e4ec574347015@mail.gmail.com>
	<49B58CB6.6030804@idi.ntnu.no>
Message-ID: <8b356f880903091531p670869bdx7f9c68e67c145862@mail.gmail.com>

On Mon, Mar 9, 2009 at 5:40 PM, Wacek Kusnierczyk
<Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> wrote:
> Stavros Macrakis wrote:
>> Tested in: R version 2.8.1 (2008-12-22) / Windows

> when i run these examples, the execution seems to get into an endless
> loop with no error messages whatsoever. ?how much time does it take
> before you get the error? ?(using r 2.8.0 and also the latest r-devel).

In 2.8.1/Windows (32 bit), they return immediately, though the
stack-overflow case is about 13x slower.

> system.time(for (i in 1:100) {trySilent((function(a=a)(a))())})
   user  system elapsed
   0.67    0.00    0.67
> system.time(for (i in 1:100) {trySilent((function(a=a)as.POSIXct(a))())})
   user  system elapsed
   0.05    0.00    0.05

Are you running under 64 bits?  How long does a vanilla infinite
recursion take to fail on your machine?  I get:

> system.time(for (i in 1:100) trySilent({fff <- function()fff(); fff()}))
   user  system elapsed
   0.27    0.00    0.26

         -s



[Rd] E`<`<rrors in recursive default argument references
Stavros Macrakis