From: Austin Ziegler Date: 2019-06-29T13:18:59-04:00 Subject: [ruby-core:93421] Re: [Ruby trunk Feature#14385] Deprecate back-tick for Ruby 3. --===============0869981735== Content-Type: multipart/alternative; boundary="0000000000002c15d0058c7998b5" --0000000000002c15d0058c7998b5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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: > > --=20 Austin Ziegler =E2=80=A2 halostatue@gmail.com =E2=80=A2 austin@halostatue.c= a http://www.halostatue.ca/ =E2=80=A2 http://twitter.com/halostatue --0000000000002c15d0058c7998b5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As a counterpoint, when I do write code that executes an e= xternal program, I have not used `program` for years, preferring %x{program= }.

-a

On Fri, Jun 28, 2019 at 1:35 PM <eregontp@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);pa= dding-left:1ex">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 programmi= ng 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 ', ye= t pretty much everyone uses them over %s{} %{} etc, unless there is too muc= h nesting.
I think backticks is a nice shortcut for shelling out, and should remain. T= here 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-7= 8957

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version:
----------------------------------------
From http= s://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20171212Japan#Fr= om-attendees

Matz hopes to deprecate backtick syntax(``) for Ruby 3. We should warn abou= t 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=3Dunsubscribe= >
<http://lists.ruby-lang.org/cgi-bin/m= ailman/options/ruby-core>


--
--0000000000002c15d0058c7998b5-- --===============0869981735== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Unsubscribe: --===============0869981735==--