another hash bug
[1/3] from: rotenca:telvia:it at: 3-Jan-2002 19:08
Here it is:
b: [1 2 3]
h: make hash! b
set [a1] b
set [a2] h
>> a1
== 1
>> a2
== make hash! [1 2 3]
a2 should be 1 like a1
---
Ciao
Romano
[2/3] from: holger::rebol::com at: 4-Jan-2002 10:02
On Thu, Jan 03, 2002 at 07:08:31PM +0100, Romano Paolo Tenca wrote:
> Here it is:
> b: [1 2 3]
<<quoted lines omitted: 6>>
> == make hash! [1 2 3]
> a2 should be 1 like a1
No. A hash! is not a block!. Only a real block! is mapped to data values
within the set block. All other block-series (hash, list, paren etc.)
are treated as single values. That's how it is documented and
implemented.
--
Holger Kruse
[holger--rebol--com]
[3/3] from: rotenca:telvia:it at: 4-Jan-2002 20:56
Hi Holger,
> No. A hash! is not a block!. Only a real block! is mapped to data values
> within the set block. All other block-series (hash, list, paren etc.)
> are treated as single values. That's how it is documented and
> implemented.
Good to know. I don't think that the documentation is so clear. I, for
example, was tricked by this core doc statement:
Closely related data types are hash! and list!. They are used in much the
same way
as block values, but have special capabilities.
And by the fact that the help of Set speaks of "block" not of "block!":
Sets a word or block of words to specified value(s).
[...]
value -- Value or block of values
If the value is a block, then each of the words in the first block will be
set to the respective values in the second block. If there are not enough
values in the second block, the remaining words will be set to NONE.
It also true that set doc never speaks of hash or list.
But perhaps i've missed some other doc.
Thanks for the info.
---
Ciao
Romano
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted