Change representation of string cursors to just i32#9
Conversation
|
A couple questions still to address here:
|
|
I think I prefer this over the initial version, because it makes things more explicit, and allows for simpler engines. To get opacity of cursor values, an option would be to introduce an opaque type for them, which (contrary to the "stringcursor is a 3-tuple" approach) is designed such that engines can implement it by using a plain integer under the hood; in other words: stick with the unboxing currently drafted here, but replace a few occurrences of The I am a bit worried about cursor validity checks, especially checking for cursors pointing at the second half of a surrogate pair. I expect that well-formed, bug-free modules will never use such cursors (so it would be sad if engines were forced to spend lots of CPU cycles on this check), but we do have to specify what happens if a module does create that situation. I think it would be best if we silently treated such a second-half-of-a-surrogate-pair like a lone surrogate (which is probably the behavior that would arise from an implementation that doesn't specifically check for this case). |
|
Thanks for the feedback @jakobkummerow ! I think given the general OK, I will take the opaque-cursor, string-measure, and validity-check-cost questions to the separate issues -- they certainly need a good answer! |
See the discussion in #6.
Fixes #6 and #8.