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
sawfish-client -e '(display-message "写篇日记吧~")' |
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
echo "Test" /tmp/test.txt |
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
(defun cons-lambda-expr (fn arglist rest-args) | |
(eval `(lambda ,rest-args | |
(apply ,fn (append ',arglist (list ,@rest-args)))))) | |
(defmacro defun/partial (name arglist &body body) | |
(let ((args (gensym)) | |
(func (gensym)) | |
(argc (length arglist)) | |
(arity (gensym)) |
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
(with-open-file (stream "/home/liutos/src/lisp/foo.lisp" | |
:direction :input) | |
(loop | |
(let ((line (read-line stream nil))) | |
(if line | |
(format t "~A~%" line) | |
(return))))) |
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
2011-cufp-scribe-preprint.pdf | |
A Manual for Hyperref.pdf | |
A Users' Manual for MetaPost.pdf | |
Asymptote中的常见问题.pdf | |
Beamer Guide.pdf | |
Blender从入门到精通.pdf | |
Computability and Complexity.pdf | |
Concatenative Programming - ICSOFT.2009.pdf | |
Conky中文文档.pdf | |
C教程测试版第二章.pdf |
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
(defmacro row->instance-of-class (row class &body slots) | |
"Create an instance of class `class' filled with values extracted from `row'. The `slots' is a list of symbols. The symbols would be used as both the place indicator and each would converts to keyword symbol for using in a implicit MAKE-INSTANCE call." | |
(let ((_row_ (gensym)) | |
(_class_ (gensym))) | |
`(let ((,_row_ ,row) | |
(,_class_ ,class)) | |
(destructuring-bind ,slots ,_row_ | |
(make-instance ,_class_ | |
,@(mapcan #'(lambda (sym) | |
`(,(read-from-string |
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
(defun multinit-list (len init-fn) | |
(loop :for i :from 1 :upto len :collect (funcall init-fn))) | |
(defun split-funcall (form) | |
(let ((args (rest form))) | |
(values args | |
(let ((argv (multinit-list (length args) #'gensym))) | |
`(lambda ,argv ,(cons (first form) argv)))))) | |
(defun append1 (list obj) |
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
(defpackage :cps | |
(:use :cl)) | |
(in-package :cps) | |
(defun append1 (list obj) | |
(append list (list obj))) | |
(defun cps-symbol (op) | |
(intern (format nil "~S&" op))) |
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
(defpackage :com.lt.compile-cps | |
(:use :cl) | |
(:export :compile-cps)) | |
(in-package :com.lt.compile-cps) | |
;;; 当且仅当expr为括号表达式,并且第一个符号为应用于CPS的变体,即符号名字符串的最后一个字符为&时 | |
;;; 才为真。 | |
(defun cpsed-p (expr) | |
"Return non-nil if the EXPR has been processed by function CONT-TRANS defined |
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
(defun same-kind-chars (c1 c2) | |
(or (and (alpha-char-p c1) | |
(alpha-char-p c2)) | |
(and (not (alpha-char-p c1)) | |
(not (alpha-char-p c2))))) | |
(defun singleton-list (list) | |
(and list (null (cdr list)))) | |
;;; 普通递归版本 |
OlderNewer