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
(progn | |
(defun gcode-lookup () | |
"カーソル位置のシンボルをGoogle Codeで検索(lisp決め打ち)" | |
(interactive) | |
(browse-url | |
(format "http://www.google.com/codesearch?q=%s+lang:%s+file:\\.%s$&hl=ja&num=20" | |
(thing-at-point 'symbol) "lisp" "lisp"))) | |
(define-key slime-mode-map [(control ?c) (control ?d) ?g] 'gcode-lookup)) |
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
(ql:quickload :hu.dwim.walker) | |
(Defpackage :walker-test | |
(:use :cl :hu.dwim.walker)) | |
(cl:in-package :walker-test) | |
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)))) |
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
;;; teepeedee2-20140713-git/src/io/posix-socket.lisp | |
(defmethod socket-accept ((fd integer)) | |
(cffi:with-foreign-object (sa 'sockaddr_in) | |
(cffi:with-foreign-object (len :int) | |
(setf (cffi:mem-aref len :int) (cffi:foreign-type-size '(:pointer (:struct sockaddr_in)))) | |
(let ((s | |
(socket-io-syscall | |
#. (progn | |
(if (accept4-supported) | |
`(syscall-accept4 fd sa len |
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
(map list | |
'#0=(#10=((1) . #1=(a)) | |
#11=((2) . #2=(b)) | |
#12=((3) . #3=(c)) | |
#13=((4) . #4=(d)) | |
(#1# #10#) | |
(#2# #11#) | |
(#3# #12#) | |
(#4# #13#) | |
. #0#) |
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* ((class (find-class 'ztesch)) | |
(class1 (fare-mop:remake-object | |
class | |
:direct-slots | |
`((:name bar | |
:readers (bar) | |
:writers nil | |
:initargs (:bar) | |
:initfunction ,(constantly nil) | |
:initform nil) |
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
(defmethod xml ((o mop-document) &optional (fn #'values)) | |
(concatenate 'string | |
"<doc>" | |
(funcall fn) | |
"</doc>")) | |
(defmethod xml ((o mop-report) &optional (fn #'values)) | |
(call-next-method o | |
(lambda () |
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
;;; AspectL | |
;; http://sourceforge.net/p/closer/aspectl/ci/master/tree/ | |
;; http://common-lisp.net/project/aspectl/overview.html | |
;; http://clozure.com/pipermail/openmcl-devel/2013-April/014253.html | |
(defclass person () | |
((name :accessor name :initarg :name))) | |
;=> #<STANDARD-CLASS PERSON> |
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 myclass (c2mop:funcallable-standard-object) | |
() | |
(:metaclass c2mop:funcallable-standard-class)) | |
(defmethod call ((obj myclass) mesg &rest args) | |
(error "foo?")) | |
(defmethod initialize-instance :before ((self myclass) | |
&key definition-source lambda-list |
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 fib (n) | |
(declare (optimize (debug 0) (safety 0) (space 0) (speed 3)) | |
(fixnum n)) | |
(labels ((fib (n) | |
(if (< n 2) | |
n | |
(let* ((fib/n-2 | |
(let ((n (- n 2))) | |
(if (< n 2) | |
n |