Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problems in Ruby 1.8.7 #2

Open
toupeira opened this issue Aug 16, 2013 · 0 comments
Open

Some problems in Ruby 1.8.7 #2

toupeira opened this issue Aug 16, 2013 · 0 comments

Comments

@toupeira
Copy link

The following work as expected in Ruby 1.9:

printf '%d' % lazy { 23 }            # -> '23'
puts lazy { [] }.respond_to? :to_ary # -> 'true'

But in Ruby 1.8.7 they seem to act on the Lazy object itself:

printf '%d' % lazy { 23 }
# TypeError: can't convert Lazy into Integer
#   from (irb):3:in `%'
#   from (irb):3

puts lazy { [] }.respond_to? :to_ary # -> 'false'

Not sure if it's possible to fix this in 1.8.7, I just thought I'd report this and ask if you know any workarounds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant