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 | |
let-inline ctx \unwrap joint = | |
match joint with | |
% matchで分割できる | |
| weed :: paper :: [] -> read-inline ctx (embed-string (weed ^ `と` ^ paper)) | |
| _ -> read-inline ctx (embed-string `ここに到達することはない`) | |
let-inline ctx \smoke joint = | |
% letでも分割できる |
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 | |
let-mutable count <- 0 | |
let-inline \counter = | |
let c = !count in | |
let () = count <- !count + 1 in | |
embed-string (arabic c) | |
in |
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: option | |
@require: stdja | |
let-inline ctx \sugoi ?:prefix s = | |
let p = Option.from `すごい` prefix in | |
read-inline ctx (embed-string (p ^ s)) | |
in | |
document (| | |
author = { Seiei MIYAGI }; |
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 | |
let-inline ctx \sugoi ?:prefix s = | |
let p = match prefix with | |
| None -> `すごい` | |
| Some(p) -> p | |
in | |
read-inline ctx (embed-string (p ^ s)) | |
in |
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 "iro" | |
using Module.new { | |
refine(Array) do | |
def type | |
self[0] | |
end | |
def lineno | |
self[1] - 1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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: math | |
let fizzbuzz = | |
let ctx = get-initial-context 10pt (command \math) in | |
page-break | |
A4Paper | |
(fun pbinfo -> (| | |
text-height = 0pt; | |
text-origin = (0pt, 0pt); | |
|)) |
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
fruits = ['apple', 'orange', 'melon'] | |
fruits.zip(1..) {|fruit, i| puts "#{i}: #{fruit}" } | |
# 1: apple | |
# 2: orange | |
# 3: melon |
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 'with_refinements' | |
module Ext | |
refine Integer do | |
def asdjflk | |
"ujihisa #{self}" | |
end | |
end | |
end |