Hi :-)

->> block: ["A" "B" "C" "D" "E" "F" "G" "H" "I"]

->> ref1: skip block 3
== ["D" "E" "F" "G" "H" "I"]
->> ref2: find block "D"
== ["D" "E" "F" "G" "H" "I"]

Now imagine {insert block "1"}:

->> print block
1 A B C D E F G H I
->> print ref1
C D E F G H I
->> print ref2
C D E F G H I

I know principles REBOL works upon are deep part of language behavior,
but sometimes the logic of particular behavior seems flawed.

The worst thing for me, as a newcomer to REBOL language, was to
understand why 'ref1 and 'ref2 contain different values after the change
is made to 'block ....

While I can see "skip block 3", even after change made to 'block as a
logical (we instructed REBOL to skip 3 elements in a 'block), I can't
see the logic of operation being right for 'ref2, as we simply
instructed REBOL to {find "D"}.

And so, as the discussion upon such topic is ongoing now, I would dare
to say some functions should refer to the same value (e.g. find), or
just provide refinement find/hook block "D", still referring to value
found, or return 'none, if we performed 'remove operation on 'block for
e.g.

But, as always, I don't know if my suggestion makes sense, or even
wouldn't require adding an extra logic to the REBOL language.

Or what about even crazier:

->> ref3: find/dual block "C" F"
== ["C" "D" "E" "F"]

so some kind of a "dual" pointer (reference), not requiring us to
copy/part the result....

->> result: copy ref3

Just my 0.2 ...

See ya,

-pekr-

Reply via email to