You need to log in to create posts and topics.
FB OOP Syntax
1,678 Posts
#1 · November 6, 2009, 9:28 am
Quote from Forum Archives on November 6, 2009, 9:28 amPosted 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:(example taken from http://en.wikipedia.org/wiki/ObjectiveC#Objective-C_2.0)[obj method:parameter]Actually I believe that we can change also some structure syntax for match the FB paradigm:interface classname : superclassname...end interfaceclass classname : superclassname...end classmethod 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 recipientrecipient = [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 scrollViewdim as ^UIImageView imageViewdim as NSInteger mapend interfaceMaybe 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
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:(example taken from http://en.wikipedia.org/wiki/ObjectiveC#Objective-C_2.0)[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 classmethod 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 recipientrecipient = [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
Click for thumbs down.0Click for thumbs up.0