On Mon, May 22, 2017 at 11:30 PM, John Cowan <xxxxxx@ccil.org> wrote:

On Mon, May 22, 2017 at 4:59 AM, Alex Shinn <xxxxxx@gmail.com> wrote:

The only cause for confusion seems to be with the use of ! for naming, and the fact that many conventional languages perform similar operations as in-place mutations.

I think that blurring the line between "must mutate" and "may mutate" was actually a !!! move by Olin in the game of standards chess.

That's actually the only point I disagree on.  The powerful new concept is "may mutate," i.e. procedures which consume their inputs leaving them unspecified afterwards.  This encourages functional programming style while allowing for efficient implementation, but really is in no way similar to "must mutate".

  By looking at the return type, unspecified vs. specified, we always know which kind of procedure we are dealing with, and the ! just gives a general warning: "beware the mutant lurking in the underbrush".

(list-set! ls k bj)     ;; return value unspecified, ls guaranteed mutated in place
(vector-fill! vec 0)  ;; return value unspecified, vec guaranteed mutated in place
(bytevector-copy! dst 0 src)  ;; return value unspecified, dst guaranteed mutated in place
(map! proc ls)      ;; equivalent to (map proc ls) returning that result; "consumes" ls - you may never refer to it again

What line is there to blur here?

--
Alex