Skip to content
Prev 173361 / 398502 Next

Is there any difference between <- and =

On 3/11/2009 10:18 AM, Sean Zhang wrote:
Use <- for assignment, and = for function arguments.  Then the 
difference between

  f( a = 3 )
  f( a <- 3 )

is clear, and you won't be surprised that a gets changed in the second 
case.  If you use = for assignment, the two lines above will be written as

  f( a = 3 )
  f( ( a = 3 ) )

and it is very easy to miss the crucial difference between them.

Duncan Murdoch