Skip to content

Instantly share code, notes, and snippets.

@bamboo
Created October 28, 2010 17:08
Show Gist options
  • Save bamboo/651812 to your computer and use it in GitHub Desktop.
Save bamboo/651812 to your computer and use it in GitHub Desktop.
macros are a beautiful thing
macro traceable_property:
case [| traceable_property $name as $type |]:
backingField = [|
private $("_$name") as $type
|]
yield backingField
yield [|
public $name:
get:
print "$self." + $(name.ToString())
return $backingField
set: $backingField = value
|]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment