Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.43.0903240236000.11646@hymn11.u.washington.edu>
Date: 2009-03-24T09:36:00Z
From: Thomas Lumley
Subject: If statement generates two outputs
In-Reply-To: <49C8A7AF.2040201@idi.ntnu.no>

On Tue, 24 Mar 2009, Wacek Kusnierczyk wrote:

> thanks.  so it seems to be intentionally parsable, though i wouldn't say
> that this gives a meaning to ':=' -- the operator has a syntactic
> category, but no semantics.  the syntactic category does not imply any
> semantics, as in
>
>    '<-' = function(a, b) NULL
>    1 <- a
>    # NULL
>
> where '<-' is still parsed the original way (as a LEFT_ASSIGN, gram.y
> again), but has now a completely different semantics.
>
> it looks like a bug to me:  ':=' is parsed on par with '<-' as a
> LEFT_ASSIGN, but apparently is not backed by any function.  it's a
> zombie.  (unless rvalues is used, that is.)

yes, it's a zombie. It used to assign to the R system environment rather than the global workspace (roughly what is the base namespace now).


     -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle