Skip to content

Instantly share code, notes, and snippets.

@od0x0
Created June 12, 2010 15:48
Show Gist options
  • Save od0x0/435839 to your computer and use it in GitHub Desktop.
Save od0x0/435839 to your computer and use it in GitHub Desktop.
macro{
//In here, we could get involved with the parsing and output of the file we are in
//Executed at compile time by the compiler
//The code in here would be considered an extension of rock
//We could use rock classes and such, like VariableAccess or VariableDecl, whatever
//Imagine that I am just switching a function call of ZombyWoof with FrankZappa within here
//A very trivial usage, but shows a point
}
FrankZappa: func(string: String){
string println()
}
ZombyWoof: func(string: String){
string+" zombie" println()
}
ZombyWoof("ZombyWoof")
//Would print ZombyWoof
FrankZappa("FrankZappa")
//Would print FrankZappa because only the function calls were switched, not the declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment