Erlang.NET icon indicating copy to clipboard operation
Erlang.NET copied to clipboard

bug in OtpErlangList iterator

Open apperly opened this issue 16 years ago • 3 comments

hi there,

been playing with your code as an alternative to otp.net. its great - thanks!

one small thing - there appears to be a bug in your implentation of GetEnumerator() on OtpErlangList. Doing a foreach over a list skips the first item! Maybe because the start parameter you pass into your inner Itr class shadows the exisiting field with the same name?

fwiw, might just be easier let the compiler write the iterator for you with yield return?

apperly avatar Dec 09 '09 16:12 apperly

Thank you, apperly! I just pushed a quick fix.

takayuki avatar Dec 10 '09 02:12 takayuki

that's great. thanks.

another request - would you consider implementing IEnumerable<OtpErlangObject> on OtpErlangTuple as well?

apperly avatar Dec 10 '09 17:12 apperly

i meant IEnumerable<OtpErlangObject> (editor doesn't like angle brackets!)

apperly avatar Dec 10 '09 17:12 apperly