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
/* | |
Algorithm W | |
*/ | |
object poly extends App { | |
type X = String | |
type U = Int | |
type Assump = Map[X, Scheme] | |
type Subst = Map[U, T] | |
type FTV = Set[U] |
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
type x = string | |
type e = | |
| EInt of int | |
| EBool of bool | |
| EVar of x | |
| EApp of e * e | |
| EAbs of x * e | |
| ELet of x * e * e | |
let rec show_e = function |
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
/* | |
Algorithm W | |
*/ | |
use std::collections::BTreeMap; | |
use std::collections::BTreeSet; | |
type X = String; | |
type U = i32; | |
type Assump = BTreeMap<X, Scheme>; | |
type Subst = BTreeMap<U, T>; |
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
class MatchError | |
attr_accessor :r | |
def initialize(a) | |
@r = self | |
@match = a | |
end | |
def >>(a) | |
self | |
end | |
def >=(a) |
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
<html> | |
<title>SmartLogJs Example</title> | |
<script src="smartlog.js"></script> | |
<script> | |
window.onload = function () { | |
var counter = 0 | |
var log = new SmartLog({ | |
el:document.getElementById("log"), | |
buildRow:function(){return { | |
head:"",text:"", |
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
:- op(1200, xfx, ['--', where, ::=]). | |
:- op(920, xfx, ['==>', '==>>']). | |
term_expansion((A where B), (A :- B)). | |
% 構文 | |
zip([], [], []). | |
zip([L|Ls], [R|Rs], [(L,R)|Ps]) :- zip(Ls, Rs, Ps). |
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
% elvm on prolog | |
:- style_check(-singleton). | |
reg(a). reg(b). reg(c). reg(d). reg(sp). reg(bp). | |
imm(N) :- integer(N), N >= 0, MAX is 256 * 65536, N < MAX. | |
update([],V,[V]). | |
update([Reg=_|R],Reg=V,[Reg=V|R]). | |
update([V1|R],V,[V1|R2]) :- update(R,V,R2). |
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
## NSON BNF | |
bool ::= 'true' | 'false' | |
value ::= '"' (not('"')|'\' _)+ '"' | |
| ('a'|...|'z'|'A'|...|'Z'|'_')('a'|...|'z'|'A'|...|'Z'|'_'|'0'|...'9')* | |
number ::= ('0'|...|'9')+ | |
| ('0'|...|'9')* '.' ('0'|...|'9')+ | ('0'|...|'9')+ '.' ('0'|...|'9')* | |
value ::= atom | number | bool | |
expression ::= value | object | array | |
object ::= '{' (value ':' expression ','?)* '}' |
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
<html> | |
<head> | |
<script src="http://pengines.swi-prolog.org/vendor/jquery/jquery-2.0.3.min.js"></script> | |
<script src="http://pengines.swi-prolog.org/pengine/pengines.js"></script> | |
<script type="text/x-prolog"> | |
/* | |
TLLP interpreter in Prolog | |
*/ | |
:- op(1060, xfy, (&)). | |
:- op( 950, xfy, [-<>, =>]). |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>$title</title> | |
$styles | |
</head> | |
<body> | |
<h1>$title</h1> |