From: John W Higgins Date: 2019-08-11T10:59:35-07:00 Subject: [ruby-core:94280] Re: [Ruby master Misc#16096] each in each (multiple uses 'each') --===============0518817483== Content-Type: multipart/alternative; boundary="000000000000577ec4058fdb2c50" --000000000000577ec4058fdb2c50 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable There is no issue here at all. a =3D [[1, 2, ,3, 4, 5]] a.each do |x\ x.each do |y| pp y end x.each do |z| pp z end pp x end Works perfectly fine. Are you certain your second for actually has any items to iterate? Remove the first embedded each loop and make sure they both work independent of each other before assuming the nesting in the issue. John On Sat, Aug 10, 2019 at 2:43 PM wrote: > Issue #16096 has been reported by D1mon (Dim F). > > ---------------------------------------- > Misc #16096: each in each (multiple uses 'each') > https://bugs.ruby-lang.org/issues/16096 > > * Author: D1mon (Dim F) > * Status: Open > * Priority: Normal > * Assignee: > ---------------------------------------- > ``` ruby > obj.each {|a| > a.some_method1.each {|b| > ... # comes here (enter) > } > a.some_method2.each {|c| > ... # does not enter here > } > } > > # tried and that way. also does not go > for a in obj > for b in a.some_method1 > ... # comes here > end > for c in a.some_method2 > ... # does not enter here > end > end > ``` > > help solve the problem. I=E2=80=99ve been suffering for 2 days. > > > > > -- > https://bugs.ruby-lang.org/ > > Unsubscribe: > > --000000000000577ec4058fdb2c50 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There is no issue here at all.

a =3D [[= 1, 2, ,3, 4, 5]]

a.each do |x\
=C2=A0 x.= each do |y|
=C2=A0 =C2=A0 pp y
=C2=A0 end
=C2= =A0 x.each do |z|
=C2=A0 =C2=A0 pp z
=C2=A0 end
=C2=A0 pp x
end

Works perfectly fine.= Are you certain your second for actually has any items to iterate? Remove = the first embedded each loop and make sure they both work independent of ea= ch other before assuming the nesting in the issue.

John
On Sat, Aug 10, 2019 at 2:43 PM <FreeKMan@protonmail.com> wrote:
Issue #16096 has been reported by D1m= on (Dim F).

----------------------------------------
Misc #16096: each in each (multiple uses 'each')
https://bugs.ruby-lang.org/issues/16096

* Author: D1mon (Dim F)
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
``` ruby
obj.each {|a|
=C2=A0 =C2=A0 a.some_method1.each {|b|
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ... # comes here (enter)
=C2=A0 =C2=A0 }
=C2=A0 =C2=A0 a.some_method2.each {|c|
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ... # does not enter here
=C2=A0 =C2=A0 }
}

# tried and that way. also does not go
for a in obj
=C2=A0 =C2=A0 for b in a.some_method1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ... # comes here
=C2=A0 =C2=A0 end
=C2=A0 =C2=A0 for c in a.some_method2
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ... # does not enter here
=C2=A0 =C2=A0 end
end
```

help solve the problem. I=E2=80=99ve been suffering for 2 days.




--
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>
--000000000000577ec4058fdb2c50-- --===============0518817483== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Unsubscribe: --===============0518817483==--