-
Notifications
You must be signed in to change notification settings - Fork 89
Define prefix operator
NN--- edited this page Apr 18, 2012
·
3 revisions
- Category: Defining Operator
- Description: Define prefix operator
- Code (in separate Macro library):
namespace MacroLibrary1
{
macro @%+(a)
syntax ("%+", a)
{
<[ $a + 1 ]>
}
}
- Code (you must include reference to macro library above):
using System;
using Nemerle;
using System.Console;
using MacroLibrary1;
def a = 9;
def r = %+a;
WriteLine(r);
- Execution Result:
10
[Copyright ©](Terms of use, legal notice)