Comments on: Changes to ordinal functions

Carl Sassenrath, CTO
REBOL Technologies
21-Aug-2006 1:15 GMT

Article #0039
Main page || Index || Prior Article [0038] || Next Article [0040] || 7 Comments || Send feedback

The ordinal functions are first, second, third, ..., last, etc.

There are two changes of interest:

 Change1Ordinals are now of type native! not action!
 ReasonPolymorphic application of these functions across all series datatypes improves the implementation.


 Change2Ordinals no longer throw an error on a past-end condition.
 ReasonBehavior is now similar to pick, returning none when past end. Experience has shown that making the ordinals throw errors when past-end was not convenient for the most common coding practices.



22-Aug-2006 18:23:16
Excellent! I don't know how many times I've hit the past-end error. Thanks also for making my favorite function append a native. It makes an appearance at least once an app and usually more since I'm such a "block-head."
Gregg Irwin
23-Aug-2006 11:35:07
Nice change! I think the consistency will help. I know there are times I choose not to use them due to the error problem.
Ladislav Mecir
23-Aug-2006 11:55:23
I will be missing the current behaviour (my reasons are explained in article), but I can adapt to the change.
Carl Sassenrath
24-Aug-2006 23:58:48
Yes, indeed, there was an original reason for the way they worked. But, I ran in to too many issues when using them for variable length series.
Maxim Olivier-Adlhoch
25-Aug-2006 15:51
Although I understand the cause and do appreciate it for many scripts (it will be simpler than pick series 1)...

can the old versions be available otherwise? a global switch or error throwing mezz (differerently spelled), something?

Now we cannot know if the value really is a none or if the series was invalid.

Maxim Olivier-Adlhoch
25-Aug-2006 15:57:59
OT, With this and other changes, at this point, I wonder how many R2 scripts will still run under R3.

Carl, have you considered changing/extending the REBOL [] header to make it clear the script is a R3 specific version?

REBOL3 []   R3 []   REBOL [needs: 'R3]  RT []


Carl Sassenrath
31-Aug-2006 14:26:05
I would be surprised if this change affected that many scripts, but it is definitely a factor to consider. (There are other areas that will have much greater impact, for example the PORT! datatype.)

The REBOL header can specify:

REBOL [needs: [3.0.1]]


REBOL [needs: 3.0.1]

And we will also accept:

REBOL [needs: 3]

Note that we don't normally allow decimal (3.0), because the decimal comparison is not exact. However, it is probably possible to allow that too.

Post a Comment:

You can post a comment here. Keep it on-topic.


Blog id:



 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.

Updated 15-Jun-2024 - Edit - Copyright REBOL Technologies -