From: Joseph Jones Date: 2015-12-17T21:06:19-07:00 Subject: [ruby-core:72265] [Ruby trunk - Feature #11758] [Open] Add keyword assignment syntax --5673863b_2901d82_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 1, 2015 at 08:15:= 01 MST, elia=40schito.me wrote:Issue =2311758 has been reported by Elia S= chito.----------------------------------------=46eature =2311758: Add key= word assignment syntaxhttps://bugs.ruby-lang.org/issues/11758* Author: El= ia Schito* Status: Open* Priority: Normal* Assignee: --------------------= --------------------I think keyword assignments would be a useful additio= n, especially since the introduction of keyword argumentsThe basic exampl= e would be, and is expected to work like required keyword arguments:=7E=7E= =7Erubya:, b: =3D =7Ba: 1, b: 2=7D=7E=7E=7EA useful use case is returning= keywords instead of multiple values making the values position independe= nt:=7E=7E=7Erubydef foo return a: 1, b: 2enda:, b: =3D fooputs a =23 =3D>= 1puts b =23 =3D> 2=7E=7E=7E-- https://bugs.ruby-lang.org/ --5673863b_2901d82_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 1, 2015 at 08:15:01 MST, elia=40schito.me wrote:
Issue =2311758 has been reported b= y Elia Schito.

----------------------------------------
=46= eature =2311758: Add keyword assignment syntax
https://bugs.ruby-lan= g.org/issues/11758

* Author: Elia Schito
* Status: Open* Priority: Normal
* Assignee:
---------------------------= -------------
I think keyword assignments would be a useful addition= , especially since the introduction of keyword arguments

The b= asic example would be, and is expected to work like required keyword argu= ments:

=7E=7E=7Eruby
a:, b: =3D =7Ba: 1, b: 2=7D
=7E= =7E=7E

A useful use case is returning keywords instead of mult= iple values making the values position independent:

=7E=7E=7Er= uby
def foo
return a: 1, b: 2
end

a:, b: =3D = foo

puts a =23 =3D> 1
puts b =23 =3D> 2
=7E=7E=7E


--
https://bugs.ruby-lang.org/
--5673863b_2901d82_16c--