Skip to content

Instantly share code, notes, and snippets.

@od0x0
Created August 13, 2010 16:50
Show Gist options
  • Save od0x0/523186 to your computer and use it in GitHub Desktop.
Save od0x0/523186 to your computer and use it in GitHub Desktop.
dereferenceIntPointer: func(pointer: Int*, jmpbufstate: JmpBuf){
if(pointer==NULL) jmpbufstate restore(Exception new("Woah dude, assign your pointers!"))
return pointer@
}
try(|state|
i = 0 : Int
printf("%i\n",dereferenceIntPointer(i&,state))
)//Returns an Exception
catch(Exception /*The class that this catch will catch*/,|exception,stateForRethrowing|
//....Blah
)//This also returns an exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment