Why are different types of quotes used in places as error messages?

Asked

Viewed 69 times

4

Eventually I see different quotes (one type of quotes to "open" and another to "close") some message, mainly in error messages.

Take, for example, an error message issued by Ruby when evaluating a reference that is not defined:

irb(main):001:0> foo
Traceback (most recent call last):
        5: from /usr/bin/irb:23:in `<main>'
        4: from /usr/bin/irb:23:in `load'
        3: from /Library/Ruby/Gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
        2: from (irb):2
        1: from (irb):2:in `rescue in irb_binding'
NameError (undefined local variable or method `foo' for main:Object)

Note here:

5: from /usr/bin/irb:23:in `<main>'

Note that to "open" the bass accent symbol has been used (`) and, to close, a single quote ('). Is there any reason for this different use? I don’t think it’s an accident, so the question.

  • stdout formatting has more to do with Shell, which Shell is used in this example?

  • zsh, but I don’t think it has anything to do with the shell. I tested on bash and the exit was the same.

  • Pq in stdout quotation marks places code, and code in backticks\ can perform functions on multiple shells.. but would also like to know if this is msm kk

1 answer

3


Where to use?

This severe accent pattern and simple quotes is not unique to error messages. See an example in a section of the bash:

Brace expansions may be nested. The Results of each Expanded string are not Sorted; left to right order is preserved. For example, a{d,c,b}e expands into `Ade ace Abe'.

Another slightly different example, with two accents and two single quotes, from the same manual:

-k file: True if file exists and its ``Sticky'' bit is set.

GNU-ism?

In the documentation of GNU, in the "Tooltips for Documentation Strings" section, there is a reference to this grave accent convention followed by simple quotes. It is called backtick-apostrophe Notation and is referred to as an old single quote convention.

In Emacs, when you `escreve' thus, the text is highlighted, which facilitates the reading of manuals using this convention. The Emacswiki recommends this standard, but notes that the origins of the convention are uncertain.

In GNU mailing lists we see that other people have already questioned the origin, but the answer given by Barry Margolin was that perhaps the authors of the GNU documentation were, unfortunately, using a font in which the characters seemed balanced, that is, something visually similar to `palavra´. However, the output to most sources was from what was actually written, `palavra', unbalanced.

Even with not so sure origin in the GNU environment, it can be said that the heritage of convention today is a GNU-ism.

Other possibilities

Another possible origin is the semantic and visual confusion of the characters with their possibilities in writing in stylized form:

  • `: severe accent with ASCII code 96
  • ": double quotes with ASCII code 34
  • ': single quotes or quote with ASCII code 39
  • ´: acute accent with ASCII code 239

Nowadays, all four characters exist separately in ASCII. Before that, some 6-bit encodings had characters that served multiple semantic purposes. An example is ' which could be used as an accent, quotation marks and apostrophe.

From this analysis, it can be understood that GNU established this pattern as a legacy of ASCII times, in which most fonts printed the characters in question curved or hyper-stylized.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.