From peter.meilstrup at gmail.com  Fri Dec 27 04:26:21 2013
From: peter.meilstrup at gmail.com (Peter Meilstrup)
Date: Thu, 26 Dec 2013 19:26:21 -0800
Subject: [Rd] RHS of assignment is evaluated eagerly?
Message-ID: <CAJoaRhZY4_scgDmCP3244-WHDQwFBqzQPH_hFz5AsAWhJAc6sw@mail.gmail.com>

Is this expected behavior, and if so, why? I would have expected
neither 'arg' nor 'value' to evaluate until forced.

`test<-` <- function(obj, arg, value) {
  1 #force no args
}
x <- 1
test(x, print("evaled arg")) <- print("evaluated value")

## [1] "evaluated value"

Peter



[Rd] RHS of assignment is evaluated eagerly?
Peter Meilstrup