From: Ryo Furue <ryofurue@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 24181@debbugs.gnu.org
Subject: bug#24181: 25.1.50; ruby mode: wrong auto indent after "?" string literal
Date: Thu, 11 Aug 2016 15:41:35 +0900 [thread overview]
Message-ID: <CAGKoo-xzECsVgZtj1-2oT40vWLo192Hi8MhY9xLef33_t_zA7w@mail.gmail.com> (raw)
In-Reply-To: <bed89924-223a-533b-4194-3c2b6e881d57@yandex.ru>
Hi,
> Thanks for the report. I'd like to fix it sometime, but it's not a big
> priority, considering this syntax is usually discouraged:
>
> https://github.com/bbatsov/ruby-style-guide#no-character-literals
Thank you for the link! It seems very comprehensive and must be useful
for many other issues, too.
I agree the bug I reported isn't a big issue.
>> ?a is a valid Ruby syntax for string literal. After writing this, I
>> learned
>> that "a".ord is equivalent (I think)
>
> Yes, in Ruby 1.9 and newer, it's a full equivalent.
After my last message, I learned that Ruby has abandoned the idea of
"character type" and instead of elevating ?a to a proper character
literal, it has made it equivalent to a single-character string "a".
So, a String is no longer a sequence of individual characters (because
"character" has no representation in the language). "a".ord returns
the character code of this single-character string but "abc".ord
ignores the "bc" part. I don't think that's a clean design, but
perhaps it's the simplest, practical one, in the face of various
character encodings. . . . That makes me wonder how Haskell handles
unicode. In that language, "String" is an alias for "[Char]" (list
of Char's). . . . I digressed.
Cheers,
Ryo
next prev parent reply other threads:[~2016-08-11 6:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 3:50 bug#24181: 25.1.50; ruby mode: wrong auto indent after "?" string literal Ryo Furue
2016-08-11 3:10 ` Dmitry Gutov
2016-08-11 6:41 ` Ryo Furue [this message]
2021-01-02 3:06 ` Dmitry Gutov
2021-08-15 12:26 ` Lars Ingebrigtsen
2021-08-15 22:21 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGKoo-xzECsVgZtj1-2oT40vWLo192Hi8MhY9xLef33_t_zA7w@mail.gmail.com \
--to=ryofurue@gmail.com \
--cc=24181@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).