Racket: quotes in import look weird

Created on 26 Aug 2019  ·  7Comments  ·  Source: racket/racket

When you import from a module named by a string, you get this:

image

The double quotes, and of two different kinds of quotes, all looks rather ugly. Since quotes already have a special meaning in that position (and the typographical differences between different kinds of quotes are lost on some people), why not use a different marker for the outer quotes instead, like «ducks feet»?

bug

All 7 comments

This is how @shriram's suggestion looks. Not sure if it's better or worse...

Screen Shot 2020-09-02 at 20 57 03

Why not just drop the outer quotes entirely when the inner module is a quoted string? So it would say imported from "a.rkt".

Another thing we could do is add styling information so the "a.rkt" would be in TT font. (We would probably want to loop in @greghendershott to get the best tradeoff between backwards compatibility and making things work with Emacs mode if we go this route.)

I agree it looks weird.

Personally, I think the best fix is simply to remove the fancy quotes.

(So that whatever follows "imported by " is simply the text you'd see in Racket source. Although I _usually_ ~dis~like fancy formatting :smile:, I think the context makes it clear that the text must be a module name, even if it is plain text.)


When I encountered this, I decided just to "cleanse" it on my, consuming end:

    (define/override (syncheck:add-mouse-over-status _text beg end status)
      (when (valid-beg/end? beg end)
        ;; Avoid silly "imported from “\"file.rkt\"”"
        (define cleansed (regexp-replace* #px"[“””]" status ""))
        (interval-map-update*! im-mouse-overs beg end
                               (λ (s) (set-add s cleansed))
                               (set cleansed))

I probably should have filed an issue here, to ask about the intent. But I think at the time I was juggling a dozen things getting this working, and forgot.

Anyway, this "cleansing" would work fine if you simply omit the fancy quotes. It would continue to help with older versions of drracket/check-syntax, and simply be harmless and N/A for newer versions.

Just removing the quotes works for me.

Robby

Removing the extra quotes also meets the standard of "what you see is what you type" (as Greg said), which is of a piece with constructor printing (a principle we've generally liked).

Although I am sure we all agree that in #lang rhombus string literals using fancy quotes should produce an EBCDIC encoded string type... I will open a separate issue for that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

corpix picture corpix  ·  7Comments

willghatch picture willghatch  ·  8Comments

MichaelMMacLeod picture MichaelMMacLeod  ·  3Comments

shhyou picture shhyou  ·  4Comments

willghatch picture willghatch  ·  7Comments