Forum Navigation
You need to log in to create posts and topics.

FB OOP Syntax

Posted by: fbcocoa.bw <fbcocoa.bw@...>

Michele wrote:


If You agree we can try to define some hypothetic syntax for OOP.

I think that we should try to stay as close as possibe to Obj-C.
Start blathering:

My provocative proposal is to just drop the ";" as line delimeter.
i.e. message sending:
[obj method:parameter]

Actually I believe that we can change also some structure syntax for match the FB paradigm:

interface classname : superclassname
...
end interface

class classname : superclassname
...
end class

method sqrrt( "root":r as double, "index":j as double) as int
...
end method = result

(I'm not sure about the pseudo-naming syntax).

Also I believe that we should avoid the inline definiton and assignment statement:
Recipient * recipient = [Recipient new];

to:

dim as ^Recipient recipient
recipient = [Recipient new]

end blathering.

Looks like a plan. So, this @interface section (taken from one of my iPhone apps):
@interface SkiMapicViewController : UIViewController <UIScrollViewDelegate> {
UIScrollView *scrollView;
UIImageView *imageView;
NSInteger map;
}

would look like this in FB?
interface SkiMapicViewController : UIViewController <UIScrollViewDelegate>
dim as ^UIScrollView scrollView
dim as ^UIImageView imageView
dim as NSInteger map
end interface
Maybe we could omit the ^ and let the translator auto-insert the necessary * before appropriate instance variables?
Bernie

--------------------------------------------------------------------- To unsubscribe, e-mail: fbcocoa-unsubscribe@welovegod.org For additional commands, e-mail: fbcocoa-help@welovegod.org