Python vs. Io

Daniel Ehrenberg LittleDanEhren at yahoo.com
Sat Jan 31 21:35:39 EST 2004


> Okay. So, if I set 'self id', like so
> 
>     self id := allocated
> 
> and want to update it later in the same block I can use
> 
>     id = "updated self 'id' slot value"
> 
> But, if I later use
> 
>     id := "set new local 'id' slot value"

Yes, but code like that is confusing and shouldn't be used unless you
need to.
> 
> in the same block I get a new local variable. Is that how it works?
> Or does the first use of a slot determine its assignment scope
> for the duration of the block?
> 
>     self a := "unchanged"
>     a := "changed"
>     write("self a is ", self a)   # changed or unchanged?

unchanged.

If you want to learn more about Io, you should probably join the Io
mailing list instead of bothering the whole usenet thread. Its website
is http://groups.yahoo.com/group/iolanguage/ .

Daniel Ehrenberg



More information about the Python-list mailing list