Hi,

I had occasion to want the starting and ending offsets of a certain chunk. I 
toyed with providing new chunklike syntax, such as 'the lineOffsets 1 to 4 of 
it'; didn't like it; then hit upon this:

the range of line 2 to 4 of it

Which would return two offsets as comma-delimited integers. It also works for 
containers:

container theCont = my title
get the range of word 2 of theCont

It also preserves container opacity -- IE, the 'black bag' effect of passing 
a chunk to a handler that accepts containers:

doMyThing item 3 of something
on doMyThing container theCont
  get the range of char 2 to 3 of theCont  -- would be "2,3", regardless of 
what theCont really is
end doMyThing

Is there a 'range' function elsewhere in xland -- does this conflict in any 
way? I like it partly because it's friendly and doesn't corrupt the 
all-important black bag effect, partly because my compiler makes implementing 
this trivial.

Dan

Reply via email to