That's odd. I would still use freeze more rubyish... :)
Terry Moore
On 22/10/2011, at 6:41 PM, Michael Johnston wrote:
> Thanks, I am using:
>
> results = NSArray.arrayWithArray(worker_results)
>
> which although it reports true for is_a?(NSMutableArray) is immutable.
>
> Cheerio,
>
> Micha
Thanks, I am using:
results = NSArray.arrayWithArray(worker_results)
which although it reports true for is_a?(NSMutableArray) is immutable.
Cheerio,
Michael Johnston
lastobe...@mac.com
On 2011-10-20, at 3:47 PM, terl wrote:
> Just a note to the original question
>
> macruby collection
Thanks.
Since there are a lot of options I'm going to do a benchmark to compare them.
For my particular workload, the problem is a "changing gears" sort of problem,
where I need to collect an aggregate result to the ui. Since the worker loop is
pretty consistent in the time each iteration takes
Just a note to the original question
macruby collections are based on objc mutable collections...e.g.
a = %w{my array of strings}
["my","array","of"strings"]
b = a.dup. b is still a mutable array.
c = NSarray.alloc.initWithArray( a ) immutable array
c << "hi"
runtime error cannot modify
On 19 Oct 2011, at 22:43, Jordan K. Hubbard wrote:
> If the mail archives were easier to search, I'd pull it up, but it isn't and
> I'm too lazy. :)
>
I set up an entry in gmane for the mailing list a while ago in order to search
the list a bit better:
http://news.gmane.org/gmane.comp.lang
Hmm thanks, I didn't realize we had a google groups mirror. I'm wondering if
we shouldn't just move there since it's much easier to use and maintain than
macosforge.
Thoughts, ideas, suggestions?
- Matt
On Thu, Oct 20, 2011 at 12:13 AM, Sven A. Schmidt wrote:
> I found that searching the google
I found that searching the google groups mirror was much easier and this might
be the thread you're referring to:
https://groups.google.com/d/topic/macruby/ceyNNqComMc/discussion
-sas
On Oct 19, 2011, at 22:43, Jordan K. Hubbard wrote:
>
> On Oct 19, 2011, at 11:38 AM, Terry Moore wrote:
>
>
I believe someone (Ernie or someone else) did indeed extract some of the
dispatch gem's mixins.
- Matt
On Wed, Oct 19, 2011 at 1:43 PM, Jordan K. Hubbard wrote:
>
> On Oct 19, 2011, at 11:38 AM, Terry Moore wrote:
>
> Yes. But he does state it is a read only not modified array. My
> understandi
On Oct 19, 2011, at 11:38 AM, Terry Moore wrote:
> Yes. But he does state it is a read only not modified array. My understanding
> is. 'Array' is an NSMutableArray, I was merely suggesting using freeze to
> throw that exception just in case there maybe some code attempting to
> write/modify.
>
Yes. But he does state it is a read only not modified array. My understanding
is. 'Array' is an NSMutableArray, I was merely suggesting using freeze to throw
that exception just in case there maybe some code attempting to write/modify.
Mutex is the way to go but it also has an overhead.
Terry M
The proper way to protect mutable objects is to use a mutex:
http://www.ruby-doc.org/core-1.9.2/Mutex.html
- Matt
Sent from my iPhone
On Oct 19, 2011, at 8:06, Chuck Remes wrote:
>
> On Oct 19, 2011, at 12:41 AM, Terry Moore wrote:
>
>> If you're not wring/changing the array no problems. Bu
On Oct 19, 2011, at 12:41 AM, Terry Moore wrote:
> If you're not wring/changing the array no problems. But to be safe use
> Object#freeze...
>
> Terry Moore
>
> On 19/10/2011, at 6:26 PM, Michael Johnston wrote:
>
>> Note, in my example I can also guarantee that none of the elements in b are
If you're not wring/changing the array no problems. But to be safe use
Object#freeze...
Terry Moore
On 19/10/2011, at 6:26 PM, Michael Johnston wrote:
> Note, in my example I can also guarantee that none of the elements in b are
> going to be changed (for example, an array of strings)
> Cheer
Note, in my example I can also guarantee that none of the elements in b are
going to be changed (for example, an array of strings)
Cheerio,
Michael Johnston
lastobe...@mac.com
On 2011-10-18, at 10:17 PM, Michael Johnston wrote:
> In ObjC, the immutable collections are threadsafe.
>
> In mac
In ObjC, the immutable collections are threadsafe.
In macruby, are collections threadsafe to read only?
ie, if I do this:
a = [ ...] # an array that may or may not be changed
b = a.dup # nowhere in the code is b ever used to add/delete/change an element
is b thread-safe to read from multiple t
15 matches
Mail list logo