-
Notifications
You must be signed in to change notification settings - Fork 89
Define operator inline function
CodingUnit edited this page Jan 9, 2012
·
6 revisions
- Category: Defining Operator
- Description: Define operator using inline function
- Code:
using Nemerle;
using System;
using System.Console;
module Inline
{
public @%++(a : int, b : int) : int
{
a + b * 2
}
}
using Inline;
def a = 9;
def r = a %++ 4;
WriteLine(r);
WriteLine(if (r == 17) "both elements are equal" else "elements not equal");
- Execution Result:
17
both elements are equal
[Copyright ©](Terms of use, legal notice)