Skip to content

Instantly share code, notes, and snippets.

@richcollins
Created April 9, 2010 16:42
Show Gist options
  • Save richcollins/361355 to your computer and use it in GitHub Desktop.
Save richcollins/361355 to your computer and use it in GitHub Desktop.
Objective-C vs. Io
//Objective-C
#import <Foundation/Foundation.h>
@interface Settings : NSObject {
NSString *email;
NSString *password;
NSString *server;
BOOL pushesMentions;
BOOL pushesBroadcasts;
int pushStartHour;
int pushStopHour;
}
@property (nonatomic, retain) NSString *email;
@property (nonatomic, retain) NSString *password;
@property (nonatomic, retain) NSString *server;
@property (nonatomic) BOOL pushesMentions;
@property (nonatomic) BOOL pushesBroadcasts;
@property (nonatomic) int pushStartHour;
@property (nonatomic) int pushStopHour;
@end
#import "Settings.h"
@implementation Settings
@synthesize email;
@synthesize password;
@synthesize server;
@synthesize pushesMentions;
@synthesize pushesBroadcasts;
@synthesize pushStartHour;
@synthesize pushStopHour;
- (void)dealloc
{
self.email = nil;
self.password = nil;
self.server = nil;
[super dealloc];
}
@end
//Io
Settings := Object clone do(
"email password server pushesMentions pushesBroadcasts pushStartHour pushStopHour" split foreach(n, newSlot(n))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment