Created
October 23, 2018 22:10
-
-
Save hanachin/6f9892bfab44cb1240b84d6a77f1614e to your computer and use it in GitHub Desktop.
SATySFiで二項演算子や単項演算子を定義する ref: https://qiita.com/hanachin_/items/14501730a3c065d63d09
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
let ( ここに演算子にしたい文字列を書く ) 引数1 引数2 = 結果 |
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
let ( ここに演算子にしたい文字列を書く ) 引数1 = 結果 |
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
@require: stdja | |
@require: list | |
let ( >> ) x lst = x :: lst | |
let-inline \dump lst = | |
let d = lst |> List.fold-left (fun acc n -> acc ^ (arabic n) ^ `;`) ` ` in | |
embed-string (`[` ^ (string-sub d 0 ((string-length d) - 1)) ^ `]`) | |
in | |
document (| | |
author = { Seiei MIYAGI }; | |
show-title = true; | |
show-toc = false; | |
title = { SATySFiで演算子定義 } | |
|) '< | |
+p { | |
\dump(1 >> 2 >> 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
@require: stdja | |
let ( !>^..^< ) s = {\>^..^\< .o( #s;にゃん )} | |
let message = !>^..^< { ねむ } | |
in | |
document (| | |
author = { Seiei MIYAGI }; | |
show-title = true; | |
show-toc = false; | |
title = { SATySFiで演算子定義 } | |
|) '< | |
+p { #message; } | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment