REBOL 3.0

Comments on: PARSE: datatype of a COPY

Carl Sassenrath, CTO
REBOL Technologies
25-Sep-2009 18:49 GMT

Article #0251
Main page || Index || Prior Article [0250] || Next Article [0252] || 2 Comments || Send feedback

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.

Name:

Blog id:

R3-0251


Comment:


 Note: HTML tags allowed for: b i u li ol ul font span div a p br pre tt blockquote
 
 

This is a technical blog related to the above topic. We reserve the right to remove comments that are off-topic, irrelevant links, advertisements, spams, personal attacks, politics, religion, etc.

REBOL 3.0
Updated 17-Oct-2017 - Edit - Copyright REBOL Technologies - REBOL.net