swarm-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [swarm-hackers] Naming conventions


From: Scott Christley
Subject: Re: [swarm-hackers] Naming conventions
Date: Wed, 18 Nov 2009 17:32:46 -0800

Your comments make sense until you dig deeper, what exactly do you mean by "Swarm style"? Of these two messages, which one is "Swarm style" and which one is "Cocoa style"?

[anObject doSomething]

[anObject doSomethingElse]


As I indicated, it is really only the instantiation methods that are an issue, otherwise an object whether it be Swarm or Cocoa is still underneath an Objective-C object and should be treated equally. I think to actual try to enforce some distinction between "Swarm" and "Cocoa" will ultimately be more confusing then to simply indicate to "use these methods" when allocating Swarm objects.

If you are suggesting that tcl/tk/blt Swarm should be source compatible with openstep Swarm, that would be a difficult task.

I'm not familiar with the GC hooks in Swarm but it's possible they are compatible. I don't really know much about how Apple's GC works.

Scott

On Nov 18, 2009, at 4:13 PM, Bill Northcott wrote:

On 19/11/2009, at 5:30 AM, Scott Christley wrote:
Do the resulting Swarm objects understand both 'new' and 'create' instantiation methods? (I understand that mixing them is a quick way to a crash.) Would this mean that they are 'first class' Cocoa objects, but that one should never invoke a Cocoa method on a Swarm object even though introspection would show it as available?

I think pretty much just the instantiation methods are an issue, so 'new' shouldn't be used for Swarm objects, but other methods should be just fine. So yes the idea is in many ways that Swarm objects be 'first class' Cocoa objects. I think though that it might be relatively straightforward to redirect the Cocoa methods 'alloc', 'new', etc to call the Swarm instantiation methods. The other possibility is to have the Cocoa methods throw exceptions and point the user to 'create', actually that was the error that Nima got when he mixed the two.

I might still try to argue that models should be written in Swarm style. So they remain portable across host systems.

Where I thought Cocoa would be useful is to write a MacOS gui for the model control, probes, spaces and graph displays. This code would be hidden from users within the Swarm framework.

I think it is hard enough to explain to users that the Swarm API is completely different to the Cocoa API (which they see in all Apple's docs), without muddying the waters by saying that the two can be mixed if you are skilled (lucky?).

Bill
PS what about garbage collection? I seem to remember there were some hooks for GC in the Swarm libraries. Can these, do these hook into Objective-C 2.0 GC? _______________________________________________
swarm-hackers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/swarm-hackers





reply via email to

[Prev in Thread] Current Thread [Next in Thread]