From Mark.Bravington at csiro.au  Fri Feb 18 04:38:09 2005
From: Mark.Bravington at csiro.au (Mark.Bravington@csiro.au)
Date: Fri Feb 18 04:38:23 2005
Subject: [Rd] eapply weirdness/bug
Message-ID: <4D99275E380CA94F998977EDACE548DC074AAC@extas2-hba.tas.csiro.au>

The following looks like an 'eapply' bug to me:

t/subtest> e <- new.env()
t/subtest> e$tempo <- quote( 1+'hi')

t/subtest> lapply( ls( e), function( x) length( get( x,e)))
[[1]]
[1] 3
# seems reasonable-- e$tempo is a 'call' object of length 3

t/subtest> eapply( e, length)
Error in 1 + "hi" : non-numeric argument to binary operator

t/subtest> eapply( e, length)
t/subtest> traceback()
1: eapply(e, length)

For some reason 'eapply' seems to *evaluate* objects of mode 'call' (it
happened with every call-mode object I tried). This shouldn't happen--
or should it?

Mark

Mark Bravington
CSIRO Mathematical & Information Sciences
Marine Laboratory
Castray Esplanade
Hobart 7001
TAS

ph (+61) 3 6232 5118
fax (+61) 3 6232 5012
mob (+61) 438 315 623


	[[alternative HTML version deleted]]


[Rd] eapply weirdness/bug
Mark.Bravington@csiro.au