[MacRuby-devel] How to detect Cylons with MacRuby

2011-01-30 Thread Martin Hawkins
I was just looking for info relating to debugging when I re-discovered this post. In it, there's a suggestion that somebody might work on XCode integration. Has there been any development around debugging? ___ MacRuby-devel mailing list MacRuby-devel@list

[MacRuby-devel] Ruby sort algorithm

2011-01-30 Thread Robert Rice
Hi: Does the Ruby Array sort algorithm maintain the relative position for children returning the same value for the comparison? I had an instance where two children having the compare value were interchanged. Thanks, Bob Rice ___ MacRuby-devel mailin

Re: [MacRuby-devel] Ruby sort algorithm

2011-01-30 Thread Morgan Schweers
Greetings, Ruby's sort algorithm is quicksort, last I checked, and quicksort is not stable (which is the property you're looking for in a sort). There are a bunch of ways around this, including writing your own, but one cute, quick, but possibly performance-impairing, approach I've seen (Matz's su

Re: [MacRuby-devel] Ruby sort algorithm

2011-01-30 Thread Robert Rice
Hi Morgan: Thanks for the info although I have to admit that I don't understand how your solutions work. I also needed my sort to return a modified flag to update the file if changed so I wrote my own bubble sort. I haven't test this yet: def sort_children # Don't trust Ruby sort to ma

[MacRuby-devel] Array and NSMutableArray mutability

2011-01-30 Thread Mark Rada
Hey, I was trying to implement a breadth first search where I would mutate the search queue while iterating through it. Simplified, it was something like this: numbers = [1, 2, 3, 4] numbers.each { |number| numbers << (1+number) unless number > 3 p

[MacRuby-devel] Strange NSDate behavior building 32 bit v 64 bit

2011-01-30 Thread Richard Sepulveda
After further investigation, I have found that the "to_f" method in my 32 bit build has problems. My simple test case, I created a new MacRuby project in the latest XCode. 1. Modified the Valid Archetectures to "i386 x86_64" 2. Added the following snippet of code to rb_main.rb NSLog( "In rb_mai

Re: [MacRuby-devel] Strange NSDate behavior building 32 bit v 64 bit

2011-01-30 Thread Vincent Isambart
> 1. Modified the Valid Archetectures to "i386 x86_64" There's a simple way to run macruby (or any other program) on the command line in 32 bits: just add "arch -i386" before the name of the program to execute: $ macruby -v MacRuby 0.9 (ruby 1.9.2) [universal-darwin10.0, x86_64] $ arch -i386 macru

Re: [MacRuby-devel] Array and NSMutableArray mutability

2011-01-30 Thread Caio Chassot
On 2011-01-30, at 23:55 , Mark Rada wrote: > > Should both types of arrays work the same way? An instance of NSMutableArray > says its class is Array, so I thought that they would. There's something weird going on in there, I don't really know the details of it, but: A while back I had issues

Re: [MacRuby-devel] Array and NSMutableArray mutability

2011-01-30 Thread Vincent Isambart
Hi, > I was trying to implement a breadth first search where I would mutate the > search queue while iterating through it. Simplified, it was something like > this: > >        numbers = [1, 2, 3, 4] >        numbers.each { |number| >                numbers << (1+number) unless number > 3 >      

Re: [MacRuby-devel] Strange NSDate behavior building 32 bit v 64 bit

2011-01-30 Thread Jordan K. Hubbard
I suppose this begs the question: Does anyone really *require* 32 bit support for MacRuby at this point? SnowLeopard is already the minimum supported config, and the only Intel 32 bit-only platforms (very early MacBook and Mac Mini configurations) are several years old now. I don't want to so

Re: [MacRuby-devel] Array and NSMutableArray mutability

2011-01-30 Thread Henry Maddocks
On 31/01/2011, at 6:37 PM, Caio Chassot wrote: > On 2011-01-30, at 23:55 , Mark Rada wrote: >> >> Should both types of arrays work the same way? An instance of NSMutableArray >> says its class is Array, so I thought that they would. > > There's something weird going on in there, I don't really

Re: [MacRuby-devel] Array and NSMutableArray mutability

2011-01-30 Thread Vincent Isambart
Hi, > Should both types of arrays work the same way? An instance of NSMutableArray > says its class is Array, so I thought that they would. This is indeed pretty confusing, so I filed a ticket to be able to easily differentiate Array and NSMutableArray: https://www.macruby.org/trac/ticket/1141