[Rd] buglet in fix() [was "function via source or fix"] (PR#602)

maechler@stat.math.ethz.ch maechler@stat.math.ethz.ch
Wed, 12 Jul 2000 08:35:58 +0200 (MET DST)


>>>>> "Erin" == Erin Hodgess <hodgess@uhddx01.dt.uh.edu> writes:

    Erin> Suppose I create a function, x.e, via the fix command:

(ESS users ESS don't ever do this, but still ...)

    >> x.e <- fix(x.e)

    Erin> When I type in x.e, the function code appears, along
    Erin> with the name/number of the environment.

Ok, in the above it was important that there's no *existing* object x.e 
beforehand.

Note that the idea about  fix() is that you only have to write

     fix(x.e)

But your problem remains :

    > fix(newerf)
    Waiting for Emacs...Done	--- I have  options(editor = "emacsclient")
    > newerf
    function ()
    {
    ## newer
    }
    <environment: 0x40862004>
    > environment(newerf)
    <environment: 0x40862004>
    > ls(env=environment(newerf))
    [1] "subx" "x"   
    >

I.e. it got the environment of the function fix -- I think this is clearly
a bug  CC'ed to  R-bugs

    Erin> However, if I create a function, y.e, and source it in, when
    Erin> I type in y.e, the function code only displays(no
    Erin> environment).

    Erin> Why is this, please?  (It's not a bug....I just wondered).

it *is* a bug, I think

    Erin> I am using R-1.1.0 for Windows.
same for Unix

    Erin> Thanks!
thank you for the report!

Martin Maechler <maechler@stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO D10	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._