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
; ModuleID = 'foo.c' | |
source_filename = "foo.c" | |
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-apple-macosx10.12.0" | |
@.str = private unnamed_addr constant [13 x i8] c"hello, world\00", align 1 | |
; Function Attrs: nounwind ssp uwtable | |
define i32 @main() #0 { | |
%1 = alloca i32, align 4 |
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 rec fact_ i acc = if i = 0 then acc else fact_ (i-1) (i+acc) in | |
let rec fact i = fact_ i 0 in | |
println_int (fact x) |
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
; ModuleID = 'foo.ml' | |
source_filename = "foo.ml" | |
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-apple-darwin15.6.0" | |
declare void @println_bool(i1) #0 | |
; Function Attrs: ssp uwtable | |
define i32 @main() #1 { | |
entry: |
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 a = 10 in | |
let rec f x = if x < 1 then 0 else x + (f (x - 1)) in | |
print_int (f a) |
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
package lexer | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"github.com/rhysd/mincaml-parser/token" | |
"io" | |
"unicode" | |
"unicode/utf8" |
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
pub fn insert(target: &mut String, index: usize, replaced: &str) { | |
for c in replaced.chars().rev() { | |
target.insert(index, 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
function peco-repos() { | |
local input | |
input="$(find "$GOPATH/src" -maxdepth 3 -mindepth 3 -name "*" -type d)" | |
input="${input}\n$(ghq list | sed "s#^#$(ghq root)/#")" | |
input="${input}\n$(ls -1 -d "$HOME/.vim/bundle/"*)" | |
input="${input}\n$(ls -1 -d "$HOME/.cache/dein/repos/"*)" | |
input="$(echo "$input" | sed "s#^$HOME#~#g")" | |
local selected_dir=$(echo "${input}" | peco --prompt 'repos >' --query "$LBUFFER") |
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
diff --git a/target/elc.c b/target/elc.c | |
index 80b08c9..030a5f8 100644 | |
--- a/target/elc.c | |
+++ b/target/elc.c | |
@@ -12,6 +12,7 @@ void target_js(Module* module); | |
void target_php(Module* module); | |
void target_el(Module* module); | |
void target_vim(Module* module); | |
+void target_viml(Module* module); | |
void target_tex(Module* module); |
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
/// <reference types="node" /> | |
import * as stream from 'stream'; | |
export declare default function hogehoge(): stream.Transform; |
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
function! s:fold(list, init, pred) abort | |
let acc = a:init | |
for item in a:list | |
let acc = a:pred(acc, item) | |
endfor | |
return acc | |
endfunction | |
echo s:fold([1, 2, 3, 4, 5], 0, {acc, i -> acc + i}) |