Preprocessor macros in Unityscript?

Is there any way at all to have proprocessor text macros when using Unityscript in Unity3D?

What I mean here is for example simply “#define” when using most c compiler stacks… so if you’re working away in XCode …

#define WHEREPNG [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/finger.png"]
#define WHERETXT [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/finger.txt"]

#define UPTHERE [((AppDelegate_Pad *)([[UIApplication sharedApplication] delegate])) simpleSpaceship]
#define WAYUPTHERE ((AppDelegate_Pad *)([[UIApplication sharedApplication] delegate]))

#define ROUGHLYPI  3.1
#define usually(x) if ([rndm half] && x)

#define DATA_CHUNK_SIZE 262144 // Deal with gzipped data in 256KB chunks
#define COMPRESSION_AMOUNT Z_DEFAULT_COMPRESSION
#define READQUEUE_CAPACITY	5

blah blah ...

(TBC, that preprocessor has complex abilities like paramaters, etc. I would be incredibly happy with simply plain text substitution text macros.)

No real JavaScript does not feature text macros and .NET languages don’t use macros either - so UnityScript is not going to do that. It does appear that Boo can, I guess its a core part of that language.

You can use Extension methods in C# which have a use a little like that to which you are putting macros - but not in UnityScript.

You can also use just plain old static methods of static classes to provide standard utility functions.

Generally speaking macros are not as robust as real method calls, which can be inlined by a compiler to provide similar performance.

Really you don’t need macros - Generic methods, consts and static methods provide 99% of the functionality with a significant improvement in compiler performance and develop-time debugging support.

Do you want something like this?