It is my understanding that “expression-style” printing was introduced
to Racket v5.0, which alters how values are printed in the REPL to
permit many printed expressions to be evaluated to produce the same
value. In contrast to the traditional Scheme write procedure, this tends
to manifest itself as additional quotes. That is, (list 1 2) will print
as '(1 2) instead of (1 2). As I understand it, the struct form was also
introduced to use the name of the struct as the constructor to make
struct printing align more with the expressions that produce them.

But everyone already knows all that. I only bring it up because I
monitor the [racket] tag on Stack Overflow[1] relatively closely, and a
whole lot of questions come up due to how people misunderstand the quote
form. I recently wrote up a relatively long answer[2] about how quote
works in the hope to create a canonical duplicate to point people to,
but someone mentioned in the comments that they found the Racket
behavior confusing, and while I was writing the answer, I found myself
questioning it a little bit, too.

There seems to be an overwhelming amount of confusion about how quote
works, especially since plenty of people seem to initially see it as
nothing more than a shorthand for the list function when really its
semantics are more (or less, depending on your perspective) complicated.
This seems to be compounded by Racket’s printing style, which puts
quotes in places where quotes traditionally would not be, and new users
unfamiliar with quotation are likely develop a misunderstanding about
how it works and what it means, since they will see quotes in the
printed representation for simple lists, even ones created with list.

I do not know how many Racket learners actually encounter this problem,
nor do I know how they actually respond. I do not know that many.
However, given how much Racket is used in education, I would imagine
that HtDP can provide some insight into how quotation should be treated
and how students react to it. HtDP itself seems to treat quote with
great care, taking pains to avoid printing it out at all until it is
introduced, but this is obviously not suitable for a full programming
environment, given that the verbose notation would be incredibly
annoying in serious programming.

I am not advocating for a change of printing style, but I would be
interested to hear others’ opinions. I like to think that Racket is
relatively accessible, but this seems to be a frequent point of
confusion (I even recently saw a newcomer to the language describe
Racket as seeming “incredibly complicated”), and I wonder if the
printing style is a sticking point or if it’s just a symptom of a more
general confusion.

Alexis

P.S. One of my absolute favorite Racket-related papers is “Mind Your
Language”[3], which describes with considerable detail how students
interact with error messages. That care and attention to the
programmer—even if not technically complex!—has recently done Elm very
well. I am personally very interested in exploring more of that.

[1]: http://stackoverflow.com/questions/tagged/racket
[2]: http://stackoverflow.com/q/34984552/465378
[3]: 
https://cs.brown.edu/~sk/Publications/Papers/Published/mfk-mind-lang-novice-inter-error-msg/paper.pdf

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to