Problem with (Ruby) bindings
I'm not sure if this is a known bug, or related to any open issues with bindings, but I found this while messing around (using r3059): # This works lv1 = 1 lv2 = 2 lv1_binding = lv1.send(:binding) lv2_binding = lv2.send(:binding) # This fails. class A lv1 = 1 lv2 = 2 lv1_binding = lv1.send(:binding) # lv1_binding gets assigned OK lv2_binding = lv2.send(:binding) # This is what fails end Assertion failed: (bind != NULL), function rb_binding_new, file proc.c, line 228. Abort trap I haven't poked into it much as it's unlikely to see much use. It might not be restricted to local variables, and I haven't had it fail by sending other methods (but I haven't tried many). Michael
Hi Group: The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method. Also string.split( "" ) does not convert the string to an array as it did before. Bob Rice
I think that String.each was mixed in from Enumerable, which 1.9 no longer does. each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem. You should file a bug for the problem with split(). On Nov 28, 2009, at 14:30, Robert Rice wrote:
Hi Group:
The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method.
Also string.split( "" ) does not convert the string to an array as it did before.
Bob Rice _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi Jordon: each is a documented method for the the string class so it should be provided. It is useful. How would I go about filing a bug report? Bob Rice On Nov 28, 2009, at 3:35 PM, Jordan Breeding wrote:
I think that String.each was mixed in from Enumerable, which 1.9 no longer does.
each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem.
You should file a bug for the problem with split().
On Nov 28, 2009, at 14:30, Robert Rice wrote:
Hi Group:
The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method.
Also string.split( "" ) does not convert the string to an array as it did before.
Bob Rice _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
each is not documented for Ruby 1.9 that I know of, only for Ruby 1.8, do you have the Pragmatic books? They don't like each as valid for String in 1.9. If you need to file a bug though (especially for your split problem) try https://www.macruby.org/trac/report Jordan On Nov 28, 2009, at 18:09, Robert Rice wrote:
Hi Jordon:
each is a documented method for the the string class so it should be provided. It is useful.
How would I go about filing a bug report?
Bob Rice
On Nov 28, 2009, at 3:35 PM, Jordan Breeding wrote:
I think that String.each was mixed in from Enumerable, which 1.9 no longer does.
each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem.
You should file a bug for the problem with split().
On Nov 28, 2009, at 14:30, Robert Rice wrote:
Hi Group:
The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method.
Also string.split( "" ) does not convert the string to an array as it did before.
Bob Rice _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Thanks Jordon: I didn't realize that some core Ruby class methods changed for 1.9. I will update my documentation. Bob Rice On Nov 28, 2009, at 7:18 PM, Jordan Breeding wrote:
each is not documented for Ruby 1.9 that I know of, only for Ruby 1.8, do you have the Pragmatic books? They don't like each as valid for String in 1.9.
If you need to file a bug though (especially for your split problem) try https://www.macruby.org/trac/report
Jordan
On Nov 28, 2009, at 18:09, Robert Rice wrote:
Hi Jordon:
each is a documented method for the the string class so it should be provided. It is useful.
How would I go about filing a bug report?
Bob Rice
On Nov 28, 2009, at 3:35 PM, Jordan Breeding wrote:
I think that String.each was mixed in from Enumerable, which 1.9 no longer does.
each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem.
You should file a bug for the problem with split().
On Nov 28, 2009, at 14:30, Robert Rice wrote:
Hi Group:
The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method.
Also string.split( "" ) does not convert the string to an array as it did before.
Bob Rice _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On Sun, Nov 29, 2009 at 10:14 AM, Robert Rice <rice.audio@pobox.com> wrote:
Thanks Jordon:
I didn't realize that some core Ruby class methods changed for 1.9. I will update my documentation.
Bob Rice
Bob, this has been well documented many months ago in both "Programming Ruby 1.9" by Dave Thomas et al and "The Programming Ruby Programming Language" by Yukihiro Matsumoto aka Matz (i.e. the creator of the Ruby programming language). -Conrad
On Nov 28, 2009, at 7:18 PM, Jordan Breeding wrote:
each is not documented for Ruby 1.9 that I know of, only for Ruby 1.8, do you have the Pragmatic books? They don't like each as valid for String in 1.9.
If you need to file a bug though (especially for your split problem) try https://www.macruby.org/trac/report
Jordan
On Nov 28, 2009, at 18:09, Robert Rice wrote:
Hi Jordon:
each is a documented method for the the string class so it should be provided. It is useful.
How would I go about filing a bug report?
Bob Rice
On Nov 28, 2009, at 3:35 PM, Jordan Breeding wrote:
I think that String.each was mixed in from Enumerable, which 1.9 no longer does.
each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem.
You should file a bug for the problem with split().
On Nov 28, 2009, at 14:30, Robert Rice wrote:
Hi Group:
The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method.
Also string.split( "" ) does not convert the string to an array as it did before.
Bob Rice _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On Sun, Nov 29, 2009 at 12:37 PM, Conrad Taylor <conradwt@gmail.com> wrote:
On Sun, Nov 29, 2009 at 10:14 AM, Robert Rice <rice.audio@pobox.com>wrote:
Thanks Jordon:
I didn't realize that some core Ruby class methods changed for 1.9. I will update my documentation.
Bob Rice
Bob, this has been well documented many months ago in both "Programming Ruby 1.9" by Dave Thomas et al and "The Ruby Programming Language" by Yukihiro Matsumoto aka Matz (i.e. the creator of the Ruby programming language).
-Conrad
On Nov 28, 2009, at 7:18 PM, Jordan Breeding wrote:
each is not documented for Ruby 1.9 that I know of, only for Ruby 1.8, do you have the Pragmatic books? They don't like each as valid for String in 1.9.
If you need to file a bug though (especially for your split problem) try https://www.macruby.org/trac/report
Jordan
On Nov 28, 2009, at 18:09, Robert Rice wrote:
Hi Jordon:
each is a documented method for the the string class so it should be provided. It is useful.
How would I go about filing a bug report?
Bob Rice
On Nov 28, 2009, at 3:35 PM, Jordan Breeding wrote:
I think that String.each was mixed in from Enumerable, which 1.9 no longer does.
each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem.
You should file a bug for the problem with split().
On Nov 28, 2009, at 14:30, Robert Rice wrote:
Hi Group:
The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method.
Also string.split( "" ) does not convert the string to an array as it did before.
Bob Rice _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi Conrad: I don't remember where I downloaded my Ruby.pdf file from - it has no credit information. I suspect you will have lots of other users upgrading directly from Ruby 1.8.7 to the new MacRuby. Bob Rice On Nov 29, 2009, at 3:38 PM, Conrad Taylor wrote:
On Sun, Nov 29, 2009 at 12:37 PM, Conrad Taylor <conradwt@gmail.com> wrote: On Sun, Nov 29, 2009 at 10:14 AM, Robert Rice <rice.audio@pobox.com> wrote: Thanks Jordon:
I didn't realize that some core Ruby class methods changed for 1.9. I will update my documentation.
Bob Rice
Bob, this has been well documented many months ago in both "Programming Ruby 1.9" by Dave Thomas et al and "The Ruby Programming Language" by Yukihiro Matsumoto aka Matz (i.e. the creator of the Ruby programming language).
-Conrad
On Nov 28, 2009, at 7:18 PM, Jordan Breeding wrote:
each is not documented for Ruby 1.9 that I know of, only for Ruby 1.8, do you have the Pragmatic books? They don't like each as valid for String in 1.9.
If you need to file a bug though (especially for your split problem) try https://www.macruby.org/trac/report
Jordan
On Nov 28, 2009, at 18:09, Robert Rice wrote:
Hi Jordon:
each is a documented method for the the string class so it should be provided. It is useful.
How would I go about filing a bug report?
Bob Rice
On Nov 28, 2009, at 3:35 PM, Jordan Breeding wrote:
I think that String.each was mixed in from Enumerable, which 1.9 no longer does.
each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem.
You should file a bug for the problem with split().
On Nov 28, 2009, at 14:30, Robert Rice wrote:
Hi Group:
The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method.
Also string.split( "" ) does not convert the string to an array as it did before.
Bob Rice _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Bob, I really don't have any information about the Ruby.pdf. In any case, I would recommend consulting an update to date reference like the ones that I mentioned below. Good luck, -Conrad On Sun, Nov 29, 2009 at 2:36 PM, Robert Rice <rice.audio@pobox.com> wrote:
Hi Conrad:
I don't remember where I downloaded my Ruby.pdf file from - it has no credit information.
I suspect you will have lots of other users upgrading directly from Ruby 1.8.7 to the new MacRuby.
Bob Rice
On Nov 29, 2009, at 3:38 PM, Conrad Taylor wrote:
On Sun, Nov 29, 2009 at 12:37 PM, Conrad Taylor <conradwt@gmail.com>wrote:
On Sun, Nov 29, 2009 at 10:14 AM, Robert Rice <rice.audio@pobox.com>wrote:
Thanks Jordon:
I didn't realize that some core Ruby class methods changed for 1.9. I will update my documentation.
Bob Rice
Bob, this has been well documented many months ago in both "Programming Ruby 1.9" by Dave Thomas et al and "The Ruby Programming Language" by Yukihiro Matsumoto aka Matz (i.e. the creator of the Ruby programming language).
-Conrad
On Nov 28, 2009, at 7:18 PM, Jordan Breeding wrote:
each is not documented for Ruby 1.9 that I know of, only for Ruby 1.8, do you have the Pragmatic books? They don't like each as valid for String in 1.9.
If you need to file a bug though (especially for your split problem) try https://www.macruby.org/trac/report
Jordan
On Nov 28, 2009, at 18:09, Robert Rice wrote:
Hi Jordon:
each is a documented method for the the string class so it should be provided. It is useful.
How would I go about filing a bug report?
Bob Rice
On Nov 28, 2009, at 3:35 PM, Jordan Breeding wrote:
I think that String.each was mixed in from Enumerable, which 1.9 no longer does.
each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem.
You should file a bug for the problem with split().
On Nov 28, 2009, at 14:30, Robert Rice wrote:
> Hi Group: > > The string.each method is undefined in MacRuby. > I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method. > > Also string.split( "" ) does not convert the string to an array as it did before. > > Bob Rice > _______________________________________________ > MacRuby-devel mailing list > MacRuby-devel@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Also, just so you know this really is a 1.8 vs 1.9 problem and not an MRI vs. MacRuby problem: 76 jordan@thetourist ~ > ruby test.rb "hello, world!" 77 jordan@thetourist ~ > /opt/homebrew/bin/ruby test.rb test.rb:3:in `<main>': undefined method `each' for "hello, world!":String (NoMethodError) 78 jordan@thetourist ~ > macruby test.rb test.rb:3:in `<main>': undefined method `each' for "hello, world!":NSMutableString (NoMethodError) test.rb: #!/usr/bin/eval ruby "hello, world!".each { |item| p item } my homebrew is 1.9 On Nov 28, 2009, at 18:09, Robert Rice wrote:
Hi Jordon:
each is a documented method for the the string class so it should be provided. It is useful.
How would I go about filing a bug report?
Bob Rice
On Nov 28, 2009, at 3:35 PM, Jordan Breeding wrote:
I think that String.each was mixed in from Enumerable, which 1.9 no longer does.
each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem.
You should file a bug for the problem with split().
On Nov 28, 2009, at 14:30, Robert Rice wrote:
Hi Group:
The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method.
Also string.split( "" ) does not convert the string to an array as it did before.
Bob Rice _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi, String#each is not supported in Ruby 1.9. Also, MacRuby is based on Ruby 1.9 specification and not 1.8. -Conrd Sent from my iPhone On Nov 28, 2009, at 4:20 PM, Jordan Breeding <jordan.breeding@me.com> wrote:
Also, just so you know this really is a 1.8 vs 1.9 problem and not an MRI vs. MacRuby problem:
76 jordan@thetourist ~ > ruby test.rb "hello, world!" 77 jordan@thetourist ~ > /opt/homebrew/bin/ruby test.rb test.rb:3:in `<main>': undefined method `each' for "hello, world!":String (NoMethodError) 78 jordan@thetourist ~ > macruby test.rb test.rb:3:in `<main>': undefined method `each' for "hello, world!":NSMutableString (NoMethodError)
test.rb:
#!/usr/bin/eval ruby
"hello, world!".each { |item| p item }
my homebrew is 1.9
On Nov 28, 2009, at 18:09, Robert Rice wrote:
Hi Jordon:
each is a documented method for the the string class so it should be provided. It is useful.
How would I go about filing a bug report?
Bob Rice
On Nov 28, 2009, at 3:35 PM, Jordan Breeding wrote:
I think that String.each was mixed in from Enumerable, which 1.9 no longer does.
each is not a method on String in 1.9 either, so I don't think this is a MacRuby problem.
You should file a bug for the problem with split().
On Nov 28, 2009, at 14:30, Robert Rice wrote:
Hi Group:
The string.each method is undefined in MacRuby. I can work around it by using string.each_byte then convert the fixnum back to a character using the i.chr method.
Also string.split( "" ) does not convert the string to an array as it did before.
Bob Rice _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
each is a documented method for the the string class so it should be provided. It is useful. As Jordan was saying String#each does not exist in 1.9 any more. And MacRuby implements Ruby 1.9, so before saying something is a bug please check with 1.9.
By the way, 1.8's String#each is now the more explicit String#each_line (there's also an Strign#each_char). And the recent releases of 1.8 also include String#each_line so I would recommend not using String#each anymore, even on 1.8.
participants (5)
-
Conrad Taylor
-
Jordan Breeding
-
Michael Winterstein
-
Robert Rice
-
Vincent Isambart