Skip to content

Instantly share code, notes, and snippets.

------------------------------------------------------------------
以下の翻訳文は、Felix Winkelmann の Thoughts on Forth Programming
(http://call-with-current-continuation.org/articles/forth.txt) の
翻訳であり、原著者の許可を得て公開するものです。
2021-09-01 Nobuhiko FUNATO (nfunato @ acm . org)
更新履歴:
2021-09-02(rev10): Shiro Kawaiさんにご指摘いただいた誤訳訂正/改善を反映
2021-09-02(rev09): 公開初版
------------------------------------------------------------------
How do we add extra information to a tree? This has been called [The
AST Typing
Problem](http://blog.ezyang.com/2013/05/the-ast-typing-problem/).
After being hit with this problem in Roy's new type-inference engine,
I tried figuring out how to represent the algorithm. I eventually
realised that it looked like a comonadic operation. Turns out it's
been done before but I couldn't find any complete example.
Below is some literate Haskell to show how to use the Cofree Comonad
@kiwanami
kiwanami / e2wm-direx-plugin.el
Created March 8, 2012 03:05
e2wm plugin for direx file list
;;; direx plugin
(require 'direx)
(require 'direx-project)
(setq direx:leaf-icon " "
direx:open-icon "▾ "
direx:closed-icon "▸ ")
(defun e2wm:def-plugin-direx (frame wm winfo)
(let* ((buf (e2wm:history-get-main-buffer))
@m2ym
m2ym / my-macrolet.lisp
Created December 3, 2011 08:09
My Macrolet
(in-package :cl-user)
(defmacro my-macrolet (&environment env bindings &body body)
(let* ((local-macros
(loop for (name lambda-list . body) in bindings
for macro-lambda = (sb-cltl2:parse-macro name lambda-list body)
for macro-fun = (sb-cltl2:enclose macro-lambda env)
collect `(,name ,macro-fun)))
(new-env (sb-cltl2:augment-environment env :macro local-macros)))
(sb-cltl2:macroexpand-all `(locally ,@body) new-env)))