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
#| foo |# | |
;;; foo | |
#;(foo | |
bar | |
baz) | |
foo bar baz | |
#| |
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
(let* ((a+b (make-string 10 :initial-element #\_)) | |
(a (make-array 5 :displaced-to a+b :element-type 'character)) | |
(b (make-array 5 :displaced-to a+b :displaced-index-offset 5 :element-type 'character))) | |
(setf (subseq a 0 2) "ab" | |
(subseq b 0 2) "cd") | |
(list a b a+b)) | |
;=> ("ab___" "cd___" "ab___cd___") |
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
総称関数を高速化してみよう(総称関数でない) | |
元ネタ | |
- http://www.doc.gold.ac.uk/~mas01cr/talks/ | |
- http://www.doc.gold.ac.uk/~mas01cr/talks/2009-05-28%20Milan/string=-specializers.lisp | |
MOPでコード生成して高速化を図るらしい。 | |
面白そうなので真似してみよう。 |
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
(flet ((run (name) | |
(with-standard-io-syntax | |
(format T "~&==== ~S ====~%" name)) | |
(funcall name))) | |
(run 'paiprolog-zebra::zebra-benchmark) | |
(run 'clog-zebra::zebra-benchmark) | |
(run 'clog-zebra::zebra-benchmark/)) | |
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 defrunlisp (name &optional lisp-exe-path) | |
(let ((sname (symbol-name name))) | |
`(defun ,(intern (concat "run-" sname)) () | |
(interactive) | |
(run-lisp ,(or lisp-exe-path sname)) | |
(rename-buffer ,(concat "*inferior-" sname "*"))))) | |
(defrunlisp sbcl "sbcl.wrapper") |
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
;;; 素の状態 | |
(loop :for cnt :from 0 | |
:do (sb-ext:call-with-timing (lambda (&key bytes-consed &allow-other-keys) | |
(unless (zerop bytes-consed) | |
(return (print (list bytes-consed cnt))))) | |
(lambda () | |
(let ((a #*10000000000000000000000000000000000000000000000) | |
(b #*10000000000000000000000000000000000000000000000)) | |
(declare (optimize (speed 3) (safety 0)) | |
(simple-bit-vector a b)) |
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 (printfoobar) | |
(define place (zowie)) | |
(place) | |
(values)) | |
(define (printfoo) | |
(define place (zowie)) | |
(values)) | |
(define (zowie) |
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
!~Filename~:! !Moon's -*-TECO-*- Library! | |
LUNAR | |
!& Load Airless Environment:! !S This is my init file | |
It's here so that comments will get compressed. | |
Argument is a string which is the user name! | |
!* process job command line ! | |
hk fj 0,0a-3"E -d' !* remove ^C at end if any! | |
0,-1a-15."E -2d' !* remove crlf at end if any.! |
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
!* -*-TECO-*- Library for PROLOG Editing System by T.Chikayama! | |
!~FILENAME~:! !Package for programming in PROLOG! | |
PROLOG | |
!& Setup PROLOG Library:! !& Set up environment for editing PROLOG codes. | |
Make *PROLOG* buffer for later use.! | |
F[D File◊ !* Save Teco Default Filename. ! | |
1,:I**PROLOG*◊M(M.M &_Find_Buffer◊)"L !* If no *PROLOG* buffer yet,! |
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
(defclass symbolic-object-class (standard-class) | |
()) | |
(defmethod allocate-instance | |
((class symbolic-object-class) &rest args &key) | |
(let ((inst (gensym "SYMBOLIC-OBJECT-"))) | |
(setf (get inst :class) class) | |
(dolist (slot (class-slots class) inst) | |
(setf (get inst (clos:slot-definition-name slot)) :unbound)))) |