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
------------------------------------------------------------------ | |
以下の翻訳文は、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): 公開初版 | |
------------------------------------------------------------------ |
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
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 |
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
;;; 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)) |
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
(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))) |