From p.dalgaard at biostat.ku.dk  Sun May  1 20:51:45 2005
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Sun May  1 20:51:54 2005
Subject: [Rd] formals assignment now strips attributres
In-Reply-To: <4274BC71.2010805@pburns.seanet.com>
References: <42736B4B.3080507@pburns.seanet.com>
	<x2ekcstq4f.fsf@turmalin.kubism.ku.dk>
	<4273EA5A.2060503@pburns.seanet.com>
	<x23bt8t2w2.fsf@turmalin.kubism.ku.dk>
	<4274BC71.2010805@pburns.seanet.com>
Message-ID: <x23bt64w5a.fsf@turmalin.kubism.ku.dk>

Patrick Burns <pburns@pburns.seanet.com> writes:

> Peter Dalgaard wrote:
...
> >>fjj <- function() x
> >>formals(fjj) <- list(x=quote(c(a=2, b=4)))
> >>fjj()
> >>
> >a b
> >2 4
> >
> >>fix(fjj)
> >>fjj()
> >>
> >a b
> >2 4
> >
> 
> But the point of using 'formals' in the first place is to get a
> function that is self-contained.  The real application is more
> like:
> 
> formals(fjj) <- list(x = an_object)
> 
> I want 'fjj' to work even when 'an_object' is nowhere to be
> found.
> 
> 'formals' worked as (I) expected in versions 1.8.0
> through 1.9.1 at least. Pat

It didn't change. It's the editing that is doing you in. There have
been changes to deparse, and they seem to have introduced a bug, but
a function object created in that way is fundamentally uneditable.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] formals assignment now strips attributres
Peter Dalgaard