[ALLY] Re: Trouble with timers???
From: carl::cybercraft::co::nz at: 25-Apr-2001 19:26
On 25-Apr-01, Terry Brownell wrote:
> Thank you, that was very helpful. But why then does this happen?
> a: [42]
> a: []
> empty? a
> == true
Because 'a is now pointing to a new block, while the original block
might still be in use, as the 'blk one was in your script. For
instance...
>> a: [42]
== [42]
>> z: a ; Both 'z and 'a now point to the block containing 42.
== [42]
>> a: [] ; This creates a new block for 'a to point to...
== []
>> z ; while 'z remains pointing to the original block...
== [42]
You /do/ eventually get the hang of this! (: It also eventually seems
a more natural way of doing things than having variable names
hard-wired to their data. Things exists, which we name, and in the
case of things like blocks with many parts, we may want to give them
many names.
> Andrew Martin <[Al--Bri--xtra--co--nz]> wrote:
> Terry wrote:
>> If you click "Start" "Stop" "Finish" "Clear".. continuously, the
>> sum
> grows and grows... it seems the blk is not clearing?
> That's right. You're not 'clear-ing the block, merely assigning it
> to a block. See:
> button "Clear" [blk: [] d: 0 y/text: "00:00:00" show y ] Note that
> the block! that 'blk is referring to, isn't 'clear-ed at all. To
> remove all the values in 'blk, do: clear blk
> Note that in Rebol, the words: blk: []
> mean set the word 'blk to the value []. In otherwords, in your
> program, here:
> blk: [] d:
> the block between "blk:" and " d: " is where the value of the block
> is. The block is not "in" 'blk. It's literally in your script.
> Rebol words act like pointers or references do in other languages.
> Andrew Martin
> ICQ: 26227169 http://members.nbci.com/AndrewMartin/
> -><-
--
Carl Read
[carl--cybercraft--co--nz]