Hello, I'd like to share few more tips.
Case 1: You want to define a property for an interface. The following
won't work:
def property = <[decl: $(my_prop):int {get;set;} ]>;
since Nemerle parser doesn't accept auto properties in quasi
quotations. And what to do? You may try constructing the expression
manually but that is difficult instead you can do this
def property = <[decl: abstract $(my_prop):int {get;set;} ]>;
properties.modifiers.mods = Nemerle.Compiler.NemerleAttributes.None;
I first define the property with abstract modifier. This allows me to
get rid of the constraint for quasi quotes. However inorder to use the
expression inside an interface I must clear the abstract modifier
which is done next line. And it works
Case 2:
You want to define an event. This case is due to a bug required to be
fixed. For the time being you can use the following:
def name' = Splicable.Name(Name(event_name.ToString
()));
def add_name = Splicable.Name(Name("add_" + field.ToString
()));
def remove_name = Splicable.Name(Name("remove_" +
field.ToString()));
def my_event = <[decl: event $(name'):System.Action
{add;remove;} ]>;
my_event.add.name = add_name;
my_event.remove.name = remove_name;
So you need to set add remove names manually and it wil work. I hope
it helps