[ruby-core:93421] Re: [Ruby trunk Feature#14385] Deprecate back-tick for Ruby 3.

From: Austin Ziegler <halostatue@...>
Date: 2019-06-29 17:18:59 UTC
List: ruby-core #93421
As a counterpoint, when I do write code that executes an external program,
I have not used `program` for years, preferring %x{program}.

-a

On Fri, Jun 28, 2019 at 1:35 PM <[email protected]> wrote:

> 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=3D$(echo $(whoami))
> > echo $foo
> > ~~~
> >
> > The example is trivial but I think you got the point ;)
>
> It's just this isn't it?
>
> ```ruby
> foo=3D`echo #{`whoami`}`
> ```
>
> Your argument would also hold for string literals with " and ', yet prett=
y
> much everyone uses them over %s{} %{} etc, unless there is too much nesti=
ng.
> 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 compar=
ed
> 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/DevelopersMeeting20171212Ja=
pan#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:[email protected]?subject=3Dunsubscrib=
e>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
>


--=20
Austin Ziegler =E2=80=A2 [email protected] =E2=80=A2 [email protected]=
a
http://www.halostatue.ca/ =E2=80=A2 http://twitter.com/halostatue

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next