I think expression-style printing is definitely helpful, but quote isn't normally helpful, especially if it's implicit like it is with vectors.
The style that makes the most sense to me is the style of the teaching languages, where (list 1 2) prints as (list 1 2). If your advice is to use (list 1 2) when in doubt, then printing it that way makes the most sense. Writing it like (1 2) as if it were quoted, but leaving out the quote, make it even more confusing, because it leads to mistakes like this: -> a (even?) -> (first a) even? -> ((first a) 5) . . application: not a procedure; expected a procedure that can be applied to arguments given: even? Which is from here: https://stackoverflow.com/questions/35122451/list-of-procedure-not-working-important This confusion doesn't come from it printing with a quote, it comes from printing as something other than an expression. When it prints as an expression, then if (first a) is 'even?, you know ((first a) 5) is equivalent to ('even? 5), which you know doesn't work, because symbols aren't functions. And when '(even?) prints as (list 'even?) then it's clear that it isn't a list containing a function, it's a list containing a symbol. I'm guessing this printing style was chosen for the teaching languages because it makes sense and minimizes confusion. Alex Knauth > On Feb 5, 2016, at 10:00 PM, Alexis King <lexi.lam...@gmail.com> wrote: > > 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.