Re: index/cursor merging [was: 120 days]
John Cowan 03 Apr 2016 19:40 UTC
Per Bothner scripsit:
> I feel very uncomfortable with this approach. It seems very error-prone.
If it troubles you, you can subtract 1 from all cursors so that they
never overlap with indexes.
> It feels inconsistent: Some procedures have "cursor" in the same,
> while some don't. Why string-ref/cursor rather than just string-ref,
> but string-pad rather than string-pad/cursor?
The ones with "/cursor(s)" are the ones that are present without cursor
support in the R7RS base library. It's certainly fine to make the
R7RS names accept cursors too, but it can't be retroactively imposed.
> It precludes an extension where negative indexes count from the end,
> as in Python.
True.
> You [John] have said before that the Scheme way is to not overload
> procedures to support different types, even when the types are different
> implementations of the same concept (such as sequences), but rather
> to have different procedures.
Indeed. But duplicating everything for indexes and cursors, as draft #2
did, is just too agonizingly painful even for me.
--
John Cowan http://www.ccil.org/~cowan xxxxxx@ccil.org
"You need a change: try Canada" "You need a change: try China"
--fortune cookies opened by a couple that I know