[MacRuby] #454: String#getbyte not working?
#454: String#getbyte not working? ------------------------------+--------------------------------------------- Reporter: paul@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- 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 -- Ticket URL: <http://www.macruby.org/trac/ticket/454> MacRuby <http://macruby.org/>
#454: String#getbyte not working? ------------------------------+--------------------------------------------- Reporter: paul@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Comment(by paul@…): Revised with better formatting: ~ $ macruby --version[[BR]] MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64] ~ $ macruby -e ' "abc".getbyte(0);'[[BR]] Abort trap -- Ticket URL: <http://www.macruby.org/trac/ticket/454#comment:1> MacRuby <http://macruby.org/>
#454: String#getbyte not working? ------------------------------+--------------------------------------------- Reporter: paul@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Comment(by lsansonetti@…): String#getbyte has not been implemented yet. We currently call abort(). -- Ticket URL: <http://www.macruby.org/trac/ticket/454#comment:2> MacRuby <http://macruby.org/>
#454: String#getbyte not working? ------------------------------+--------------------------------------------- Reporter: paul@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: ------------------------------+--------------------------------------------- Comment(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? -- Ticket URL: <http://www.macruby.org/trac/ticket/454#comment:3> MacRuby <http://macruby.org/>
I'm pretty sure you can use NSString#characterAtIndex s = "Brian" s.characterAtIndex(0) # => 66 Brian On Wed, Nov 25, 2009 at 4:46 PM, MacRuby <ruby-noreply@macosforge.org> wrote:
#454: String#getbyte not working? ------------------------------+--------------------------------------------- Reporter: paul@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: ------------------------------+---------------------------------------------
Comment(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?
-- Ticket URL: <http://www.macruby.org/trac/ticket/454#comment:3> MacRuby <http://macruby.org/>
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
#454: String#getbyte not working? ------------------------------+--------------------------------------------- Reporter: paul@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: minor | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | ------------------------------+--------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: MacRuby 0.5 => MacRuby 0.6 Comment: #getbyte and friends are now supported as in 1.9 in the new String class. Check out trunk. -- Ticket URL: <http://www.macruby.org/trac/ticket/454#comment:4> MacRuby <http://macruby.org/>
participants (2)
-
Brian Chapados
-
MacRuby