Projects

Ticket #454 (closed defect: fixed)

Opened 2 years ago

Last modified 23 months ago

String#getbyte not working?

Reported by: paul@… Owned by: lsansonetti@…
Priority: minor Milestone: MacRuby 0.6
Component: MacRuby Keywords:
Cc:

Description

It appears the new String method called getbyte for Ruby 1.9 is not working? Results in an "Abort trap" message.

~ $ macruby --version MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]

~ $ macruby -e ' "abc".getbyte(0);' Abort trap

Change History

Changed 2 years ago by paul@…

Revised with better formatting:

~ $ macruby --version
MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]

~ $ macruby -e ' "abc".getbyte(0);'
Abort trap

Changed 2 years ago by lsansonetti@…

String#getbyte has not been implemented yet. We currently call abort().

Changed 2 years ago by paul@…

Is String#getbyte on the roadmap somewhere. Given the new multibyte strings in Ruby 1.9, String#getbyte seems to be the only way to get the old behaviour of directly accessing bytes (rather than characters) in a string? OTOH I suppose there would be a Cocoa way to do that?

Changed 23 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from MacRuby 0.5 to MacRuby 0.6

#getbyte and friends are now supported as in 1.9 in the new String class. Check out trunk.

Note: See TracTickets for help on using tickets.