Skip to content

Instantly share code, notes, and snippets.

@NilsHaldenwang
Created April 7, 2011 20:26
Show Gist options
  • Select an option

  • Save NilsHaldenwang/908638 to your computer and use it in GitHub Desktop.

Select an option

Save NilsHaldenwang/908638 to your computer and use it in GitHub Desktop.
Still does not work,...
> mirahc macro_test.mirah
Parsing...
macro_test.mirah
Inferring types...
Inference Error:
macro_test.mirah:23: Cannot find instance method name_set(java.lang.String) on MacroTest
m.name = "Nils"
^^^^^^^^^^
class MacroTest
macro def attr_reader(attr)
quote {
def `attr`
@`attr`
end
}
end
macro def attr_writer(attr)
quote {
def `"#{attr}_set"`(val:String)
@`attr` = val
end
}
end
attr_reader :name
attr_writer :name
def self.main(args:String[]):void
m = MacroTest.new
m.name = "Nils"
puts "My name is #{m.name}."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment