behavior of =

A.J. Rossini rossini@u.washington.edu
08 Nov 2002 09:55:34 -0800


>>>>> "duncan" == Duncan Murdoch <dmurdoch@pair.com> writes:

    duncan> On Fri, 8 Nov 2002 08:17:12 -0800 (PST), you wrote:
    >> On Fri, 8 Nov 2002, Philippe Grosjean wrote:

    >>> foo(a=b)  # Assignment of b to a, and a is passed as first argument to
    >>> function foo()
    >>> foo(a:=b) # b is passed to the named argument 'a' of function foo()
    >>> 
    >> 
    >> Not only would this require rewriting essentially every piece of R code
    >> ever written, but even worse, := is used in other languages (and in the
    >> prehistory of R) as an assignment operator so it would be even less clear
    >> than the current situation.

    duncan> I would say a better change (but not good enough to be worth doing,
    duncan> because it would break so much) would be to drop "=" as an assignment
    duncan> operator, and use ":=" for that purpose.

Why not "<-"  instead of ":="?  I still don't understand why this is
in anyway better (except for pascal and modula programmers, see
Thomas' point from a while back: "If you want those constructs, use
those languages", is application.

best,
-tony

-- 
A.J. Rossini				Rsrch. Asst. Prof. of Biostatistics
U. of Washington Biostatistics		rossini@u.washington.edu	
FHCRC/SCHARP/HIV Vaccine Trials Net	rossini@scharp.org
-------------- http://software.biostat.washington.edu/ ----------------
FHCRC: M: 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email
UW:   Th: 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX
(my tuesday/wednesday/friday locations are completely unpredictable.)



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._