
Issue #20235 has been updated by rubyFeedback (robert heiler). I think the first time - and probably the only time - I heard about the ?a syntax: ?a # => "a" ?b # => "b" ?c # => "c" was in the pickaxe book. I believe there was a chapter in the bookaxe that mentioned the ? syntax along with .chr and .ord, or something like that. I don't recall ever having used that syntax again in like 15 years ago, so from that point of view I agree with Dan0042. Then again I don't know all possible use cases, but provided there are no substantial use cases then Dan0042 may have a point. p $stdin.closed?=>true leads to an error whereas p $stdin.closed? =>true does not lead to an error. Although perhaps the parser could differentiate between these two use cases; but the basic question is still how useful ?a and how popular it may still be. Perhaps there is some way to find out how often ruby users use the ?char syntax? I can not recall any gem using it actually. ---------------------------------------- Feature #20235: Deprecate CHAR syntax https://bugs.ruby-lang.org/issues/20235#change-106584 * Author: Dan0042 (Daniel DeLorme) * Status: Open * Priority: Normal ---------------------------------------- I propose deprecating the `?c` syntax. It served a purpose in ruby <= 1.8, but no longer. The reason I'm proposing this is because today I ran into this error: ```ruby p $stdin.closed?=>true # comparison of String with true failed (ArgumentError) ``` I was completed mystified, and had to resort to Ripper to figure out what's going on ``` p *Ripper.lex("p $stdin.closed?=>true") [[1, 0], :on_ident, "p", CMDARG] [[1, 1], :on_sp, " ", CMDARG] [[1, 2], :on_gvar, "$stdin", END] [[1, 8], :on_period, ".", DOT] [[1, 9], :on_ident, "closed", ARG] [[1, 15], :on_CHAR, "?=", END] #OOOOHH!!!!! [[1, 17], :on_op, ">", BEG] [[1, 18], :on_kw, "true", END] ``` We don't have to commit to a removal schedule right now, but I think it would at least be good to print a deprecation message if $VERBOSE. -- https://bugs.ruby-lang.org/