Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0


  • Performance. I'm not all that great with squeezing every ounce of performance out of things, thus my char-range function is probably the best you'll get from me. I don't know the real performance implications.
  • If many things can be rangeable, they should probably be polymorphic.
  • Are there things that might need to be rangeable in more than one way?

I have some design ideas on of my own, mostly char-range specific:

  • Should char-range's upper bound be exclusive? How intuitive and easy would that be to work with? It would mean that, to get the lower-case alphabet, you'd have to do (char-range \a \\\{) rather than (char-range \a \z). That is awkward and unreadable. Ultimately, it's a difficult decision to make between consistency and usability.
  • char-rang range should be as flexible as possible. The priority should be on ultimately flexibility and not how easy it is to get a range of lower-case and upper-case letters.
  • Being polymorphic opens a huge can of worms. If we have a Rangeable protocol, none of the range functions can have a no-argument version. I imagine we'd have a 'range' function that would be a wrapper around the protocol. It's possible that, for no argument, this function could default to what the range function defaults to right now, which is a range of numbers from 0 to infinity.
  • Being polymorphic also makes differences in behavior ugly. Inclusive vs exclusive will become a huge problem in all of this. Ruby gets away with this by making exclusive behavior optional with a default argument. We could possibly do something similar.

Sorry for the first example's curly bracket not coming out right. It appears to be impossible to escape it and show a backslash in this markup language. If somebody else can manage it, please do so.