[REBOL] Re: tag!
From: carl:cybercraft at: 26-Jan-2002 3:55
On 26-Jan-02, Hallvard Ystad wrote:
> I like that tag! is a datatype.
> But.
> It's not a string. So certain things that may be done to strings may
> not be done to tags.
> Still, it sometimes behaves like it's not really a datatype of its
> own, but, in fact, a string.
>>> a: <a href="">
> == <a href="">
>>> b: <a href ="">
> == <a href ="">
>>> a = b
> == false
It's not a block, but it is a series, like a block and a string are...
>> a: <a href="">
== <a href="">
>> series? a
== true
And RT have decided that each character in a tag can be accessed...
>> foreach n a [print n]
a
h
r
e
f
> Shouldn't a = b return true here? In my opinion, these two tags are
> alike, just like two blocks with different spacing:
>>> blk1: [ 1 2 3 ]
> == [1 2 3]
>>> blk2: [
> [ 1 2
> [ 3]
> == [
> 1 2
> 3]
>>> blk1 = blk2
> == true
> Is this behaviour wanted? To what degree is tag! a datatype?
tag! is definately a datatype. If you need a tag's contents to behave
like a block, you could use to-block...
>> c: to-block a
== [a href= ""]
but it won't give consistant results. Your other example would give
this for instance...
>> to-block <a href ="">
== [a href = ""]
HTH, anyway...
> ~H
> Prętera censeo Carthaginem esse delendam
--
Carl Read