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
;; -*- Mode: Lisp; Syntax: Common-Lisp -*- | |
;; | |
;; 第1回 Scheme コードバトン (CL fork) | |
;; | |
;; ■ これは何か? | |
;; 「Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。」のCL版です。 | |
;; 次回 Shibuya.lisp で成果を発表します。 | |
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。 | |
;; | |
;; ■ 2 つのルール |
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
;; -*- Mode: Lisp; Syntax: Common-Lisp -*- | |
;;; Package Management | |
(in-package :cl-user) | |
(defpackage :hige | |
(:use :cl) | |
#+ABCL (:shadow :y-or-n-p) | |
(:export #:pin | |
#:pon |
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
;; 第1回 Scheme コードバトン | |
;; | |
;; ■ これは何か? | |
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。 | |
;; 次回 Shibuya.lisp で成果を発表します。 | |
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。 | |
;; | |
;; ■ 2 つのルール | |
;; | |
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。 |
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
;;; show *buffer-package* in buffer bar | |
(pushnew '(show-lisp-package-mode . *buffer-package*) | |
*minor-mode-alist* :key #'car) | |
(defvar-local show-lisp-package-mode nil) | |
(defun show-lisp-package-mode (&optional (arg nil sv)) | |
(interactive "p") | |
(ed::toggle-mode 'show-lisp-package-mode arg sv) | |
(update-mode-line t) |
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
#!/usr/local/bin/sbcl --script | |
(print (parse-integer(second *posix-argv*))) | |
(load #P"/tmp/http.test/quicklisp/setup.lisp") | |
(ql:quickload '(:hunchentoot :trivial-shell)) | |
(hunchentoot:start | |
(make-instance 'hunchentoot:acceptor | |
:port (parse-integer(second *posix-argv*)))) |
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
(defun export-symbols-from-package (package) | |
"export all symbols from a package." | |
(loop :for s :being :the :present-symbols :in package | |
:when (or (ignore-errors (fdefinition s)) | |
(ignore-errors (find-class s nil)) | |
(boundp s)) | |
:do (export s))) |
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
(asdf:defsystem #:temp | |
:default-component-class cl-source-file.lsp | |
;; cl-source-file.lsp/cl-source-file.cl can be used. | |
:serial t | |
:components ((:file "temp"))) |
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
(daemon:daemonize :exit-parent t) | |
(with-open-file (out #P "/tmp/daemonlog" :direction :output :if-exists :supersede) | |
(format out "~A ~A~%~A~%" | |
(lisp-implementation-type) | |
(lisp-implementation-version) | |
(daemon::getpid))) | |
(sleep 90) | |
(daemon:exit) |
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
(ql:quickload :daemon) | |
(daemon:daemonize :exit-parent t) | |
(ql:quickload '(:ningle :drakma)) | |
(defparameter *log-file* (merge-pathnames "test.log" (user-homedir-pathname))) | |
(defparameter *gc-log-file* (merge-pathnames "gc.log" (user-homedir-pathname))) | |
(defparameter *ningle-instance* (make-instance 'ningle:<app>)) | |
(when (zerop (daemon:fork)) | |
(loop :repeat 20 |
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
(defun copy-directory (from to &key overwrite) | |
(let ((len (length (namestring (truename from))))) | |
(cl-fad:walk-directory | |
from | |
(lambda (x) | |
(cl-fad:copy-file | |
x | |
(ensure-directories-exist | |
(merge-pathnames | |
(subseq (namestring x) len) |
OlderNewer