[ruby-core:93415] [Ruby trunk Feature#14385] Deprecate back-tick for Ruby 3.
From:
eregontp@...
Date:
2019-06-28 17:35:00 UTC
List:
ruby-core #93415
Issue #14385 has been updated by Eregon (Benoit Daloze).
nrodriguez (Nicolas Rodriguez) wrote:
> You use the same symbol "`" for the begining and the end of the instruction which is not a good thing to do when you design a programming language as it creates ambiguities.
> For example with this syntax you can't nest multiple calls.
> In Bash $() is prefered over backticks for that reason.
> How would you express such a call with backticks without ambiguities :
>
> ~~~ text
> foo=$(echo $(whoami))
> echo $foo
> ~~~
>
> The example is trivial but I think you got the point ;)
It's just this isn't it?
```ruby
foo=`echo #{`whoami`}`
```
Your argument would also hold for string literals with " and ', yet pretty much everyone uses them over %s{} %{} etc, unless there is too much nesting.
I think backticks is a nice shortcut for shelling out, and should remain. There are very few usages of %x{}, and that looks quite ugly to me compared to backticks.
----------------------------------------
Feature #14385: Deprecate back-tick for Ruby 3.
https://bugs.ruby-lang.org/issues/14385#change-78957
* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version:
----------------------------------------
From https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20171212Japan#From-attendees
Matz hopes to deprecate backtick syntax(``) for Ruby 3. We should warn about it at Ruby 2.6 (or 2.7?)
We need to consider them.
* warning message
* warning level
* ?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>