Comments on: PARSE: datatype of a COPY
In a parse rule, what's the datatype of a COPY action?
In A83, it assumes it's the same datatype as the parse input. Take a look at these examples:
parse "test" [copy s to end (print type? s)]
string!
parse %test [copy s to end (print type? s)]
file!
parse http://test [copy s to end (print type? s)]
url!
parse #{3034} [copy s to end (print type? s)]
binary!
parse [a b] [copy s to end (print type? s)]
block!
parse 'a/b [copy s to end (print type? s)]
path!
This is a change from R2. But, is this what we want to do? The alternative is to use the datatypes base-type.
There are reasons either way. Which is the most useful for us?
2 Comments Comments:
Oldes 25-Sep-2009 19:07:09 |
I like this change, especially for binary! datatype. I'm not sure how useful it can be with datatypes like url! | Brian Hawley 25-Sep-2009 22:34:34 |
In bug#1066, we specifically rejected the old R2 behavior and stated that the datatype should be the same as the input type. The main reason is so we don't get locked into the "base type" semantics in future implementations of REBOL. That would be too presumptuous for PARSE to do. |
Post a Comment:
You can post a comment here. Keep it on-topic.
|