You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would argue there is consistency with the other types in any-word!
>> length? /a==2>> length? quote :a==2
Rebolbot commented on Nov 5, 2010:
Submitted by:Sunanda
That makes some sense....If, conceptually, the length of a word! is its molded form.
But then length? :a is a little anomaly...perhaps its length should be zero when a has no value
mold/a=="/a"
mold#a=="#a"
mold:a=="unset!";; so why a length of 2!?
Rebolbot commented on Nov 5, 2010:
Submitted by:meijeru
You will notice I programmed length? quote :a, just to avoid the unset! problem. You should try mold quote :a, it has a length of 2 allright. The refinement and the issue do not need to be quoted because they are never further evaluated (they are pure literals).
Hostilefork commented on Apr 11, 2019:
This is resolved in Ren-C because ISSUE! is returned to an ANY-STRING!:
Allowing one to directly take the length of an ANY-WORD! was tried for a while. Letting words be treated as a kind of read-only series (without a position) has some benefits, but also runs risks of having a symbol be processed accidentally as being something other than atomic.
It is legal in Ren-C to alias the underlying UTF-8 data of an ANY-WORD! into a string cell without making a copy...so as text! 'foo gives you "foo" as a read-only string. Hence, this is what you should do for now instead of directly trying to take the length of a word (or iterate it with FOR-EACH, etc.)
Hostilefork added the Ren.resolved on Apr 11, 2019
The text was updated successfully, but these errors were encountered:
Submitted by: Sunanda
Now in R3:
Intentional?
Imported from: CureCode [ Version: alpha 110 Type: Issue Platform: Windows Category: Datatype Reproduce: Always Fixed-in:none ]
Imported from: metaeducation#1740
Comments:
Submitted by: meijeru
I would argue there is consistency with the other types in any-word!
Submitted by: Sunanda
That makes some sense....If, conceptually, the length of a word! is its molded form.
But then length? :a is a little anomaly...perhaps its length should be zero when a has no value
Submitted by: meijeru
You will notice I programmed length? quote :a, just to avoid the unset! problem. You should try mold quote :a, it has a length of 2 allright. The refinement and the issue do not need to be quoted because they are never further evaluated (they are pure literals).
This is resolved in Ren-C because ISSUE! is returned to an ANY-STRING!:
metaeducation/ren-c#980
Allowing one to directly take the length of an ANY-WORD! was tried for a while. Letting words be treated as a kind of read-only series (without a position) has some benefits, but also runs risks of having a symbol be processed accidentally as being something other than atomic.
It is legal in Ren-C to alias the underlying UTF-8 data of an ANY-WORD! into a string cell without making a copy...so as text! 'foo gives you "foo" as a read-only string. Hence, this is what you should do for now instead of directly trying to take the length of a word (or iterate it with FOR-EACH, etc.)
The text was updated successfully, but these errors were encountered: