Last active
January 24, 2018 11:09
-
-
Save kmizu/5a52486f3a7015747c6caa0f1e2b0a6d to your computer and use it in GitHub Desktop.
Nemerleで n == 1 && n == 2 && n == 3をtrueにする ref: https://qiita.com/kmizu/items/77c1f4244502c4dd4058
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Nemerle.Compiler; | |
macro @==(lhs, rhs) { | |
<[ | |
true | |
]> | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ncc -r Nemerle.Compiler.dll -t:dll eq_macro.n -o eq_macro.dll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Hello | |
{ | |
static Main () : void | |
{ | |
def a = 1; | |
Console.WriteLine(a == 1 && a == 2 && a == 3); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ncc -r eq_macro.dll Hello.n -o Hello.exe | |
Hello.n:7:9:7:10: warning: N168: a local value a was never used (defined in 'Main() : void') | |
Hello.n:7:9:7:10: hint: replace name with `_' or prefix it like `_bar' to avoid the warning | |
$ ./Hello.exe | |
True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment