bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48681: Patch: Make prettify-symbols-mode work with ruby-mode


From: William Denton
Subject: bug#48681: Patch: Make prettify-symbols-mode work with ruby-mode
Date: Wed, 26 May 2021 23:52:32 -0400 (EDT)
User-agent: Alpine 2.22 (DEB 394 2020-01-19)

On 26 May 2021, Stefan Monnier wrote:

+(defconst ruby--prettify-symbols-alist
+  '(("and" . ?∧)
+    ("&&" . ?∧)

Are `and` and `&&` absolutely 100% completely totally equivalent in Ruby?

+    ("or" . ?∨)
+    ("||" . ?∨)

Same question for `or` and `||`?

An excellent question, and I think I overstepped things. The documentation¹ and answers on Stack Exchange² say "&&" and "||" are logical operators (so the logical symbols work) but "and" and "or" have lower precedence and are used differently.

It'd be best to just prettify "&&" and "||" with symbols, and anyone who wants "and" and "or" could add those by hand. Shall I send a revised patch, or do you just want to delete those bits?

Thanks,

Bill

¹ https://ruby-doc.com/core/doc/syntax/precedence_rdoc.html
² E.g. https://stackoverflow.com/a/2083118/854346
--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]