secret variables?

View: New views
3 Messages — Rating Filter:   Alert me  

secret variables?

by bblochl2-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a problem of understanding:
Io 20090105
Io> sin := 5
==> 5
Io> 4 sin
==> -0.7568024953079282
Io> sin
==> 5
Io> 1x := 5
==> 5
Io> x1:= 6
==> 6
Io> slotSummary
==>  Object_0x9384378:
  Lobby            = Object_0x9384378
  Protos           = Object_0x93842a8
  exit             = method(...)
  forward          = method(...)
  sin              = 5
  x1               = 6

Io> 1x
==> 5
Io>

Io does not have keywords or reserved words - ok, true. sin is a slot of Protos and a variable at the same time. But why is the variable 1x not listet as a slot of Protos? It is real and usable. Is it an error or does it have a deeper meaning, i. e. as secret, magic variables?

Is it possible to clear slots, say extract it, not to make it zero or nil.  

Thanks BB


Re: secret variables?

by Jeremy Tregunna-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Do a

1 slotNames

You'll find x there.

Regards,

Jeremy Tregunna
Mobile: +1 (519) 498-8299

Sent from my iPhone

On 2009-07-13, at 16:57, bblochl2 <bblochl2@...> wrote:

> I have a problem of understanding:
> Io 20090105
> Io> sin := 5
> ==> 5
> Io> 4 sin
> ==> -0.7568024953079282
> Io> sin
> ==> 5
> Io> 1x := 5
> ==> 5
> Io> x1:= 6
> ==> 6
> Io> slotSummary
> ==>  Object_0x9384378:
>  Lobby            = Object_0x9384378
>  Protos           = Object_0x93842a8
>  exit             = method(...)
>  forward          = method(...)
>  sin              = 5
>  x1               = 6
>
> Io> 1x
> ==> 5
> Io>
>
> Io does not have keywords or reserved words - ok, true. sin is a  
> slot of Protos and a variable at the same time. But why is the  
> variable 1x not listet as a slot of Protos? It is real and usable.  
> Is it an error or does it have a deeper meaning, i. e. as secret,  
> magic variables?
>
> Is it possible to clear slots, say extract it, not to make it zero  
> or nil.
>
> Thanks BB
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

Re: secret variables?

by Steve Dekorte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 2009-07-13, at 1:57 PM, bblochl2 wrote:
> But why is the variable 1x not listet as a slot of Protos?

1x is parsed as "1 x"

> Is it possible to clear slots, say extract it, not to make it zero  
> or nil.

Yes, you can use:

Object removeSlot(slotName)