John Cowan's review John Cowan (25 Jun 2019 22:41 UTC)
Re: John Cowan's review Linus Björnstam (10 Sep 2019 18:21 UTC)
Re: John Cowan's review Shiro Kawai (10 Sep 2019 22:20 UTC)

Re: John Cowan's review Linus Björnstam 10 Sep 2019 18:21 UTC

I don't know why I can't reply to this properly. Here is the reply I sent to John (and only John, by mistake):

On Wed, 26 Jun 2019, at 00:41, John Cowan wrote:
> Dependencies:
> R7RS-small has the right kind of define-record-type
> vector->list of the kind you want is in R7RS-small
>
> Suggested name changes, mostly to align with SRFI 1:
> transduce -> list-transduce
> append-map -> tappend-map (a typo?)
> tcat -> tconcatenate
> tdedupe -> tdelete-neighbor-dupes
> tremove-duplicates -> tdelete-duplicates
> tpartition-all -> tsegment
> tpartition-by -> tpartition
> tindex -> tenumerate

This are all very good. Thank you. I have thought about tindex a bit. My thoughts have been to make tmap-indexed take a two argument procedure (of index and element) and implement renumerate using that. This gives tmap-indexed less overhead (and a less surprising interface imo).

>
> Semantics:
> tdedupe and tremove-duplicates need to accept an equality predicate. If
> the underlying hash table package can't handle arbitrary equality
> predicates, it should at least handle eq?, eqv?, and equal?.

Also very good. In the early revisions (long before Arthur asked me to make it a srfi) I used srfi-69 based hash tables and had such an interface. I will add it to the srfi.

>
> tremove-duplicates needs to specify which element is retained,
> presumably the earliest.
>
> I don't understand the purpose of the tref argument to thalt-when. Without
> this argument it seems to be the same as drop-while, except with the
> predicate negated. Add some more explanation clarifying its purpose.

It lets you specify how to act when a predicate-triggering value has been found. The functionality can easily be implemented using an optional parameter to ttake-while, which is a better path than having a separate transducer.

I will remove it in the upcoming draft.

>
> Implementation issues:
> Don't encourage the use of reverse!. It can be very slow when the
> garbage collector has a write barrier, because it mutates every pair,
> in which case it is faster to use a functional reverse.

Considering the amount of schemes out there that use reverse! at the end of (map ...) I want to allow for it, especially since transducers are good at handling lots of data. How do you think I should best accommodate it? By not mentioning it at all?

>
> Markup:
> ttake and tdrop (in the transduce procedure) need to be in code font.
> Same with treplace in the treplace procedure.
> In thalt-when, pred? is code font instead of italics.

Will do. I am currently on vacation in Italy, so any changes will be made when I return to Sweden in early July.

--
  Linus Björnstam

On Wed, 26 Jun 2019, at 00:40, John Cowan wrote:
> Dependencies:
> R7RS-small has the right kind of define-record-type
> vector->list of the kind you want is in R7RS-small
>
> Suggested name changes, mostly to align with SRFI 1:
> transduce -> list-transduce
> append-map -> tappend-map (a typo?)
> tcat -> tconcatenate
> tdedupe -> tdelete-neighbor-dupes
> tremove-duplicates -> tdelete-duplicates
> tpartition-all -> tsegment
> tpartition-by -> tpartition
> tindex -> tenumerate
>
> Semantics:
> tdedupe and tremove-duplicates need to accept an equality predicate. If
> the underlying hash table package can't handle arbitrary equality
> predicates, it should at least handle eq?, eqv?, and equal?.
>
> tremove-duplicates needs to specify which element is retained,
> presumably the earliest.
>
> I don't understand the purpose of the tref argument to thalt-when. Without
> this argument it seems to be the same as drop-while, except with the
> predicate negated. Add some more explanation clarifying its purpose.
>
> Implementation issues:
> Don't encourage the use of reverse!. It can be very slow when the
> garbage collector has a write barrier, because it mutates every pair,
> in which case it is faster to use a functional reverse.
>
> Markup:
> ttake and tdrop (in the transduce procedure) need to be in code font.
> Same with treplace in the treplace procedure.
> In thalt-when, pred? is code font instead of italics.
>
>
> John Cowan http://vrici.lojban.org/~cowan xxxxxx@ccil.org
> Knowledge studies others / Wisdom is self-known;
> Muscle masters brothers / Self-mastery is bone;
> Content need never borrow / Ambition wanders blind;
> Vitality cleaves to the marrow / Leaving death behind. --Tao 33 (Bynner)
>
>
>