From maechler at stat.math.ethz.ch  Tue Nov 18 14:14:49 2008
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Tue, 18 Nov 2008 14:14:49 +0100
Subject: [Rd] assign("FALSE", TRUE)
In-Reply-To: <4921F798.6010006@biostat.ku.dk>
References: <3EFAB5FA-61AF-4646-8C17-288838AB075B@auckland.ac.nz>
	<18721.60440.551783.840625@cmath-5.math.ethz.ch>
	<4921F798.6010006@biostat.ku.dk>
Message-ID: <18722.49097.70529.650997@stat.math.ethz.ch>

>>>>> "PD" == Peter Dalgaard <p.dalgaard at biostat.ku.dk>
>>>>>     on Tue, 18 Nov 2008 00:00:40 +0100 writes:

    PD> Martin Maechler wrote:
    >> But in spite of all that I agree that I'd have liked
    >> `FALSE` <- <whatever> to signal an error about the fact
    >> that it is a reserved word.
    >> 
    RT> This is clearly not a very important issue, but it might
    RT> bear some thinking about.
    >> 
    >> Yes.  I'd propose that R-core look into how to make
    >> assignment to a reserved word an error.

    PD> I disagree. In a sense, this is the point of having the
    PD> backtick operator: allowing you to work with names that
    PD> would otherwise be syntax errors (notice that such names
    PD> are sometimes created outside your control, e.g. via
    PD> column names in data frames). If you start disallowing
    PD> some of them again, well, that way lies madness!

No, no. I'm not against allowing names that are otherwise syntax
errors.  They were always possible via assign().
I just am convinced we should not allow reserved words.
{ S / S-plus does not either and gives a nice error message:

  S> assign("FALSE", TRUE)
  Problem: The name "FALSE" is reserved -- assignments to it are not allowed 
}

Martin



[Rd] assign("FALSE", TRUE)
Martin Maechler