On Sat, Aug 5, 2017 at 6:23 PM, Sudarshan S Chawathe <xxxxxx@eip10.org> wrote:
 
- Is the recommendation to use SRFI-14 char-sets for characters
  motivated by (expected) performance benefits, or something else
  (such as compatibility with SRFI-13)?  A brief clarification would
  be useful.

Note added.

- Specification, 3rd paragraph: Is it correct that for lists (when
  they are elements of an oset or obag), the "object" is the list
  (recursively) and not just the initial pair?

Added "in such a way that the hash function of the comparator returns a different value."

- I don't understand the second itemized point under "benefits to this
  convention" (assuming the ! versions of procedures are being used).
  It seems to me that if one decides to use the ! procedures on an
  oset, then the old version, if needed, needs to be saved separately
  by copying, etc.

Reworded the first half to say "Between linear updates, programmers may treat osets and obags as purely functional data structures"

- oset constructor: Seems implied by the description of oset/ordered,
  but is it correct that it is not an error to invoke the oset
  constructor with duplicated elements?  (A similar comment applies to
  oset-unfold.)

It is not an error; adding an existing element (in the sense of the equality predicate) to an oset (not an obag) is ignored.  I have added this as a general paragraph of the specification and adjusted procedure-specific language accordingly.
  
- Is it correct that oset-contains? uses the oset's equality predicate
  to check membership?

Yes; fixed.
 
- Related to above, is it true that (oset-member xs k d) is equivalent to
  (if (oset-contains? xs k) xs d)?

Yes.
 
- oset-search: Is the "expected to tail call..." interpreted as a
  "MUST tail call..." (in RFC 2119 terms)?  That is, calling the
  procedures in a non-tail position, or not at all, an error (or just
  potentially inefficient)?

It is an error, but we don't use 2119 modals for the programmer's obligations.  I have added "(otherwise it is an error)" to both sentences.

- In the context of obags, the naming convention for "oset-delete" and
  "oset-delete-all" may be easy to misinterpret as referring to
  deleting just one or all matching elements (cf. Java's "remove" and
  "removeAll").

Good point, but SRFI 113 controls the names here.  Originally -delete deleted only one thing, and -delete-all deleted all those mentioned in a list.  Then -delete was extended to accept multiple elements to delete, which made -delete-all basically redundant.
 
- oset-map: The example has the order of comparator and proc reversed
  from the order in the signature.

The signature was changed to agree with SRFI 113 PFN 2, but the example was not.  Example fixed.
 
- oset-map, last sentence in description: Should it read "... elements
  are not the same in the sense of eqv?..."?

Yes; fixed.
 
- oset-map: The handling of duplicate elements mentions "omitted as in
  the oset constructor" but the oset constructor does not have the
  details (such as, which of several equal-by-comparator elements is
  retained).  Also applies to list->oset.

Clarified.
 
- In general, I am a bit unsure of the handling of elements that are
  equal-by-comparator but otherwise distinguishable (by eqv?, eq?,
  equal?).

Hopefully the new draft is clean in this respect. 

- Comparators: It may be nice if oset-comparator an obag-comparator
  did provide ordering predicates (so as to make it convenient to
  build osets of osets and so on).  Given the ordering of elements, a
  lexicographic ordering may make sense.

I'm uncertain about this, so taking no action now except to make it an issue.

- oset=?, etc.: Probably obvious, but perhaps worth noting that "same"
  here refers to equal-by-comparator.

Added. 

- oset-min-value and oset-max-value: These don't make sense to me.
  Are they left over from mappings?

Removed. 
 
- oset-element-predecessor and oset-element-successor: Is it an error
  if oset does not contain the given obj?

Reworded to say "Returns the largest/smallest element in the oset that is smaller/larger than obj".
 
- Dividing osets: It seems useful to also allow both ends of a range
  to be specified, to get objects in the ranges [a,b], (a,b], etc.''

Rejected.  I think this API is large enough already, and these features are marginal.
 
- oset-catenate: Should "the oset element" read "a singleton oset
  containing element" or some such?

Changed to "the element".
 
- Obag procedures section, first para: I am a bit confused here (and
  earlier, for osets) by the special consideration given to eqv? (v.,
  in particular, equal?).  Does the comment about eqv? also hold true
  if eqv? is replaced with equal? there?  (I think so, based on the
  following paragraph, but then I am confused as to why only eqv? is
  mentioned.)

Eqv? is special because it is Scheme's identity predicate.  It is a general rule (see R7RS section 3.4) that when you fetch the contents of a location, the object you get is eqv? to the object you stored there.  Finer-grained predicates such as eq? are not necessarily preserved (a number you fetch is not necessarily eq? to the number you stored, for example).  Of course, if two objects are eqv? they are also equal?, as R7RS spells out.
 
- Would it make sense (perhaps in another SRFI if out of scope here)
  to define (o)bags that do separately store items that are
  equal-by-comparator?  I am thinking here of applications that may
  wish to use an obag for grouping objects that do need to be treated
  separately later.

I think in that case you should be using a finer-grained equality predicate.
 
- obag-product: Probably obvious, but may be useful to explicitly note
  that n should be an exact nonnegative integer.

Added.
 
- obag-for-each-unique and obag-fold-unique: It may be useful to add a
  note/reminder here that it is undefined which of a group of
  equal-by-comparator elements is given to proc.

Added.
 
- obag->alist: May be just me, but "car" and "cdr" may be clearer than
  "elements" and "values" for describing the alist, although the
  correspondence is fairly obvious.

Done.  Should have been "keys" and "values" anyway, but R7RS does not use this language, so I won't either.
 
- alist->obag and alist/ordered->obag: The comparator mentioned in the
  description is missing from the signature.

Added as the second argument.
 
- alist->obag: What happens in case of an alist with multiple pairs with
  equal-by-comparator 'car's?  Are the number of occurrences summed as
  in oset-sum (or maxed as in oset-union)?

Neither.  Clarified that elements with already existing cars are ignored.
 
 - Abstract: The parenthetical remark seems a bit odd to me since
    osets and obags are not very common terms.  Perhaps the terms
    should be expanded here?

Search-and-replace disease.  Fixed.
 
- Rationale: Second sentence has an extra "and".

Fixed.
 
  - Specification, para 5: I believe "for" should read "from".

Fixed.
 
  - Linear update section, para 2: "so clients" -> "So clients" (or
    perhaps the preceding period should be a comma?)

Changed to a comma.
 
-- 
John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
I am he that buries his friends alive and drowns them and draws them
alive again from the water. I came from the end of a bag, but no bag
went over me.  I am the friend of bears and the guest of eagles. I am
Ringwinner and Luckwearer; and I am Barrel-rider.  --Bilbo to Smaug