Skip to content

Instantly share code, notes, and snippets.

View pasberth's full-sized avatar

pasberth pasberth

View GitHub Profile
@ympbyc
ympbyc / instructions.txt
Created August 9, 2012 10:09
3impのVMの内部動作再入門。けっこう忘れてた。
((lambda (A) A) 1)
-> compile ->
(frame (halt) (constant 1 (argument (close (A) (refer A (return)) (apply)))))
------- VM ---------
a - アキュムレータ 一時的な値を保存しておく
x - (今回実行するインストラクション [引数,...] (次に実行するインストラクション [引数,...] (...))
@ympbyc
ympbyc / smalltalk72.md
Created October 12, 2012 14:12
smalltalk 72 メモ. まだ実際に触ってないから想像含む。OSX Lionでたまたま使えたグリフを使ってるので見れない人はごめんなさい。
"=>はif。ほんとは⇒"
cond => (then) else

"<oはアイボールって言って続くトークンを読む.ほんとは専用のグリフがある。"
<o someToken

"☞はlispのquoteみたいなやつ。続く式を評価しない。"

"変数への代入は←。←は普通のメッセージなので変数はクオートしてやらないといけない"
@ponkore
ponkore / clojure-reader-macro.md
Created December 3, 2012 15:32
Clojure のリーダーマクロについて (lisp reader macro advent calendar 2012 の記事です)。

Clojure のリーダーマクロについて

この記事は、lispリーダーマクロアドベントカレンダー の4日目の記事です。 タイトルにある通り、Clojure でのリー ダーマクロについて取り扱います(対象とする Clojure のバージョンは 1.4)。

はじめに

@ympbyc
ympbyc / Krivine.scm
Created December 7, 2012 21:03
Krivine's Machine
;;;; Krivine's Machine in Scheme ;;;;
;;; 2012 Minori Yamashita <ympbyc@gmail.com> ;;add your name here
;;;
;;; reference:
;;; http://pauillac.inria.fr/~xleroy/talks/zam-kazam05.pdf
;;; http://pop-art.inrialpes.fr/~fradet/PDFs/HOSC07.pdf
;;; Notes ;;;
;; CLOSURE creates thunks that packs the continuation and environment together.
;; To create closures(function objects), CLOSURE the GRAB and expression followed by CONTINUE.
@rummelonp
rummelonp / zsh_completion.md
Last active February 22, 2023 15:06
zsh の補完関数の自作導入編

zsh の補完関数の自作導入編

あまり深く理解してないので識者のツッコミ大歓迎

補完を有効にする

取り敢えず最低限だけ

# 補完を有効にする

臨床心理学特講

千葉少年鑑別所 小粥

少年鑑別所とは?

  • 家庭裁判所の一割くらいが入る
  • 事件の中でも特に、精密に鑑別が必要になるような場合
  • 強制的に収容する施設
  • 社会に戻れるか、少年院に行くか
@chomado
chomado / gijinka.md
Last active December 15, 2015 23:39 — forked from pasberth/gijinka.md
  • Haskellは天才過ぎて大学行ってる15歳
  • RubyはモテモテJK
  • Pythonは真面目委員長、風紀委員
  • LISPは部活
  • Javaは最近あんまり人気無い
  • COBOLは用務員のおばあちゃん
--- ProofGeneral-4.3pre130327.orig/Makefile 2013-01-16 06:48:49.000000000 +0900
+++ ProofGeneral-4.3pre130327/Makefile 2013-04-10 09:45:49.000000000 +0900
@@ -62,7 +62,7 @@
# only during compilation. Another idea: put a function in proof-site
# to output the compile-time load path and ELISP_DIRS so these are set
# just in that one place.
-BYTECOMP = $(BATCHEMACS) -eval '(setq load-path (append (mapcar (lambda (d) (concat "${PWD}/" (symbol-name d))) (quote (${ELISP_DIRS}))) load-path))' -eval '(progn (require (quote bytecomp)) (require (quote mouse)) (require (quote tool-bar)) (require (quote fontset)) (setq byte-compile-warnings (remove (quote cl-functions) (remove (quote noruntime) byte-compile-warning-types))) (setq byte-compile-error-on-warn t))' -f batch-byte-compile
+BYTECOMP = $(BATCHEMACS) -eval '(setq load-path (append (mapcar (lambda (d) (concat "${PWD}/" (symbol-name d))) (quote (${ELISP_DIRS}))) load-path))' -eval '(progn (require (quote bytecomp)) (require (quote mouse)) (require (quote tool-b
(ns macro-combinator
(:refer-clojure :exclude [=]))
(defn prim [x] (fn [a] `(fn [~x] ~a)))
(defn in [v a] (v a))
(defn where [a v] (v a))
(defn = [v b] (fn [a] `(~(v a) ~b)))
(defn <- [v b] (fn [a] `(>>= ~b ~(v a))))
(println (in (= (prim 'x) 42) 'x))
; ((clojure.core/fn [x] x) 42)

Syntax

Receiver message arg1 arg2 arg3 ==  self message receiver aeg1 arg2 arg3

self message returns a function whose type is receiver -> arg1 -> arg2 -> arg3 .

self message is undefined, but the message will be hooked by core function like AUTOLOAD,