Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: On ordinal and cardinal numbers...

From: joel:neely:fedex at: 7-Jul-2001 1:44

Jeff Kreis wrote:
> > I think that having 0-based analogs of the following words > > would be *quite* sufficient: INDEX? SKIP AT PICK POKE > > LENGTH? >
I wouldn't see a change here. The block below has a length of ten elements, regardless of which way the positions are labeled IMHO. 1-org 1 2 3 4 5 6 7 8 9 10 block [ a b c d e f g h i j ] 0-org 0 1 2 3 4 5 6 7 8 9 just as there are ten numbers in each of the sets {1 ... 10} and {0 ... 9}
> foo/0 ? >
If you're referring to the naming question, PRO: Less typing than /zero. CON: Still subject to the 0-vs-O issue. Not a big deal either way IMHO. If you mean FOO/0 as a path, then I'd assume that it's still a synonym for PICK FOO 0 and that re-interpreting it as a synonym for PICK0 FOO 0 is not an option at this point. Carl Has Spoken (as is his perfect right and role), so we're only talking about the *addition* of 0-origin capabilities, not a *change* from 1-origin to 0-origin. It is certainly the case that adding 0-origin words/refinements doesn't break any code (as long as we don't reinterpret paths) and that's a legitimate concern. Based on his phrasing "If you really feel that you need a native or two to deal with it..." I assumed that the other option that had been raised (having some sort of global flag that would switch all existing words between 1- and 0-origin behavior) was not acceptable/feasible.
> How does SKIP change? >
After rereading Ladislav's message more carefully, and doing a bit of experimenting for myself, I now think I'd like to remove SKIP/ZERO (or SKIP0) from my proposed list. I would prefer to keep any discussion of how SKIP (etc.) behave at the boundaries as a separate issue from the 0- or 1-origin issue. -jn- --------------------------------------------------------------- There are two types of science: physics and stamp collecting! -- Sir Arthur Eddington joel-dot-neely-at-fedex-dot-com