[Ohrrpgce] thoughts about slice handles
James Paige
Bob at HamsterRepublic.com
Wed Jan 14 22:21:24 PST 2009
On Wed, Jan 14, 2009 at 10:11:40PM -0800, S'orlok Reaves wrote:
>
> > Another option is to just make a couple commands like:
> > create string slice(stringID)
> > update string slice(stringID)
> I know this is way beyond the context of this email chain, but is it possible, given an ID, to detect if this is an old-style string ID or a new-style slice ID, and then pass it to the appropriate function automatically?
>
> I know that your original idea could do this, but I dis-liked the large indices (although I understand your use of them, now). What about creating a new "type" in the HSpeak bytecode:
>
> Kind "1" is (already) for numbers.
> Make kind "8" be "slice IDs", or "handles".
Hmmm... Interesting. So you are suggesting extending the existing "kind"
system to add other data types to the language, right?
> It seems like slices are going to be a huge, completely separate part of your infrastructure, so why try to multiplex them onto the "number" type, where they just add confusion? Moreover, this allows you to have a middle layer between handles and their internal representation, so that you can change from a big array to a linked list, to an array of linked lists (or whatever) without worrying about breaking existing code.
Well, I am hoping that slices will not really be completely separate. I
intend to migrate a lot of code to use them, and although the migration
process introduces a risk of breakage, it also introduces and even
larger risk of bugfixage, since most of the old code is so crufty and so
badly in need of a cleaning.
> You'll need a little bit of syntax for this in Hamsterspeak, of course, and in CUSTOM. What do you think?
But what syntax, I wonder?
I'd love to hear TMC weigh in on this one.
---
James
More information about the Ohrrpgce
mailing list