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 cat | |
((&key (to nil) | |
(trim '()) | |
prefix | |
postfix) | |
&body form#list-of-list) | |
(let* ((form#list-of-list#2 | |
(apply (function append) | |
(mapcar (lambda (list) | |
(list prefix |
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 the following principle | |
1 2 (add) = 1 (add 2) = (add 1 2) | |
all the following code blocks eval to the same result | |
i.e. function called "fun" applys to arguments 1 2 3 | |
----------------------------------- | |
2 1 (sub) |
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
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <stddef.h> | |
#include <time.h> | |
// the following are reported by : man 2 stat | |
struct the_stat { | |
dev_t st_dev; /* ID of device containing file */ | |
ino_t st_ino; /* inode number */ | |
mode_t st_mode; /* protection */ |
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
(define hash-table-preparation-interface | |
(interface () | |
hash-table:get-size | |
in-cicada-key->key | |
create-in-cicada-key | |
key->finite-sum | |
key-equal? | |
hash)) |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(regexp-match-positions | |
(regexp | |
(cat | |
((object-name (regexp "needle"))) | |
(" ") | |
((object-name (regexp "needle"))))) | |
"hay needle needle stack") |
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
(define-syntax cat | |
(syntax-rules () | |
[(cat (str . args)) | |
(format str . args)] | |
[(cat (str . args) (str2 . args2) ...) | |
(string-append | |
(cat (str . args)) | |
(cat (str2 . args2) ...))])) | |
(define-syntax orz |
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
(letrec ([f (lambda (x) (cons 'a x))] | |
[g (lambda (x) (cons 'b (f x)))] | |
[h (lambda (x) (g (cons 'c x)))]) | |
(cons 'd (h '()))) | |
;; (d b a c) | |
(letrec ([f (lambda (x k) (k (cons 'a x)))] | |
[g (lambda (x k) (f x (lambda (v) (k (cons 'b v)))))] | |
[h (lambda (x k) (g (cons 'c x) k))]) | |
(h '() (lambda (v) (cons 'd v)))) |
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
(require (for-syntax syntax/parse)) | |
(define-syntax fun | |
(lambda (stx) | |
(syntax-parse stx | |
#:literals (->) | |
[(fun [v ... -> r ...] ...) | |
(syntax | |
(match-lambda** [(v ...) (begin r ...)] ...))]))) |
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
* 一羣屎殼郎定理 | |
- 保守力定理 | |
不動點定理 | |
一羣屎殼郎定理 | |
- 假設一 | |
每個人在解決問題時 | |
都會使用自己所能想到的最優解法 |
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
命令行中文補全 | |
假設當前路徑下有且僅有 '小學' '數書' '書法' 三個子路徑 | |
當我在命令行裏有如下輸入 ('|' 代表光標的位置) | |
cd x| | |
此時按 <tab> 將爲我做如下補全 | |
cd 小學/| | |
當有 |
OlderNewer