[top][index]
search for:

<- -- assignment with left side evaluated

x <- y -- assigns the value of y to x, but x is evaluated, too.

If the value of x is a symbol, then the value of y is assigned as the value of that symbol. If the value of x is a hash table, then the value of y must be one, too, and the contents of y bodily replace the contents of x. If the value of x is a list, then the value of y must be a list, and the contents of y replace the contents of x.

Warning: if y is a class with instances, these instances will NOT become instances of x. If instances of x are created later, then they will not be compatible with the instances of y. One should try to avoid using <- in this case.

The value of the expression x <- y is x, with its new contents.

See also:

  • = -- assignment

  • [top][index]
    search for: