Last active
May 26, 2019 05:06
-
-
Save puripuri2100/4e188eb5e75e42b0a0532b50a6d6783d to your computer and use it in GitHub Desktop.
{|a|b|c|}を受け取ったら[[{1};a];[{2};b];[{3};c]] にしてくれる関数
This file contains 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-mutable it-num <- 0 | |
let add-num-list it-list = | |
let () = it-num <- 0 in | |
let add-num it = | |
let () = it-num <- !it-num + 1 in | |
(it, !it-num) | |
in | |
List.map add-num it-list | |
let convert (it, num) = | |
let it-num = arabic num |> embed-string in | |
[it-num; it] | |
let main it-list = | |
add-num-list it-list |> List.map convert |
This file contains 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 | |
@import: nest | |
let-inline ctx \test list = | |
let main-list = main list in | |
let show-it-list list = | |
match list with | |
| it-num :: it :: [] -> {[#it-num;\; #it;]\;} | |
| _ -> {} | |
in | |
List.map show-it-list main-list |> List.map (read-inline ctx) |> List.fold-left (++) inline-nil | |
in | |
document (| | |
title = {test}; | |
author = {putiputi2100}; | |
show-title = false; | |
show-toc = false; | |
|) '< | |
+p{\test{|a|b|c|d|}} | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment