3 ms·
This uses SubjectiveScript.m by same author: https://github.com/kmalakoff/SubjectiveScript.m https://github.com/kmalakoff/SubjectiveScript.m A, N are typedefs
by upinsmoke 14y ago
This uses SubjectiveScript.m by same author: https://github.com/kmalakoff/SubjectiveScript.m https://github.com/kmalakoff/SubjectiveScript.m
A, N are typedefs of existing types.
"While JavaScript allows flexibility in variable types, Objective-C requires explicit variable types. To try to keep it brief, I tried to condense types down to the shortest name possible:
typedef BOOL B;
typedef NSInteger I;
typedef NSUInteger UI;
typedef float F;
typedef double D;
typedef id KV[2]; // key-value pair
#define NSO NSObject
#define A NSMutableArray
#define NSA NSArray
#define O NSMutableDictionary
#define NSD NSDictionary
#define S NSMutableString
#define NSS NSString
#define Date NSDate
#define N NSNumber
#define E NSException"
Just read that want me to stay far away from this.
- kalleboo 14y agoI'm not sure why this guy just doesn't use MUMPS instead
- joubert 14y agoShortening NSUInteger to UI is anti-ergonomic in a language used to construct UI's. I'm also surprised that O stands for NSMutableDictionary but NSD for NSDictionary. What is an "O"? Another thing I would argue is that using the shorter #defines for mutables would encourage their use. Instead, it might be prudent to encourage use of the immutables.
- mikeash 14y agoMost of those typedefs are just silly, but the KV typedef is outright dangerous, since arrays are treated very differently from other values in C. Try returning a KV from a method and you're in for a big surprise.