Skip to content

Instantly share code, notes, and snippets.

@k33g
Created March 4, 2015 20:42
Show Gist options
  • Save k33g/583cf5f9d7b45a07ecac to your computer and use it in GitHub Desktop.
Save k33g/583cf5f9d7b45a07ecac to your computer and use it in GitHub Desktop.
augmentedStruct human = {
fields = {
firstName,
lastName
}
methods = {
function hello = |this| {
println("hello")
}
function ctor = |this, first, last| {
this: firstName(first)
this: lastName(last)
return this
}
}
}
@yloiseau
Copy link

yloiseau commented Mar 5, 2015

Use case for macros :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment