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
(setq load-path | |
(cons "~/.emacs.d/site-lisp/elisp" load-path)) | |
(require 'auto-complete) | |
(setq-default ac-sources '(ac-source-abbrev ac-source-words-in-buffer)) | |
(global-auto-complete-mode t) | |
(setq ac-auto-start 3) | |
(add-hook | |
'emacs-lisp-mode-hook | |
(lambda () | |
(setq ac-sources '(ac-source-words-in-buffer ac-source-symbols)))) |
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
;;; ref. http://github.com/yhara/ShogiModan | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(unless (find-package :modanshogi) | |
(defpackage :modanshogi | |
(:use #+:xyzzy :lisp | |
#-:xyzzy :common-lisp)))) | |
(provide 'modanshogi) |
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
;;; ref. http://blog.practical-scheme.net/gauche/20100428-shorter-names | |
;;; http://d.hatena.ne.jp/higepon/20100511/1273584001 | |
#+:xyzzy | |
(require 'cmu_loop) | |
(defmacro ^ (args . body) | |
`(lambda ,args ,@body)) | |
(defmacro define-caret-macros (chars) |
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
;;; Tetrlang Interpreter for xyzzy | |
;;; 元ネタ | |
;;; わーい、テトリス言語 Tetrlang 完成したよー\(^o^)/ | |
;;; http://d.hatena.ne.jp/athos/20100707/tetrlang | |
(defpackage :tetrlang | |
(:use :lisp :editor)) | |
(in-package :tetrlang) |
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; package:shobon -*- | |
;;; forked from http://pc12.2ch.net/test/read.cgi/software/1226425897/809 | |
;;; | |
;;; *usage* | |
;;; M-x shobon | |
;;; M-x shobon-toggle-status | |
;;; M-x shobon-toggle-modeline | |
(defpackage :shobon |
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
;;; ref. http://blog.livedoor.jp/dankogai/archives/51524639.html | |
(define S (lambda (x) (lambda (y) (lambda (z) ((x z) (y z)))))) | |
(define K (lambda (x) (lambda (y) x))) | |
(define U (lambda (x) ((x S) K))) | |
(define (%parens base compose) | |
(lambda (code) | |
(let r ((c code)) | |
(unless (list? c) (error "proper list required, but got" c)) |
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
;;; ref. http://blog.livedoor.jp/dankogai/archives/51524639.html | |
(= p[(rfn r(c f)(if c(r cdr.c(f:p c.0))f))_[(_:fn(x)(fn(y)[x._ y._]))[fn(y)_]]]) | |
(((p'(#0=(#1=((())))#2=(#0#(#1#(#0#))#0#)(())#4=(#0##2#(()))#4##4#)) [+ _ 1]) 0) | |
; -> 65536 |
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
;;; ref. http://practical-scheme.net/gauche/man/gauche-refj_16.html#SEC18 | |
(defmacro debug-print (form stream) | |
`(progn | |
(format t "~&#?=~S:~S:~S~%" | |
,(or *load-pathname* | |
(when (buffer-stream-p stream) | |
(buffer-name (buffer-stream-buffer stream))) | |
stream) | |
,(si:*stream-line-number stream) |
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
;; utility functions to define class methods | |
(defun extract-argument-symbols (args) | |
(mapcar #'(lambda (x) (if (listp x) (car x) x)) args)) | |
(defun has-class-method-p (method class arguments) | |
(let ((methods (compute-applicable-methods method (cons class arguments)))) | |
(dolist (m methods) | |
(let ((specializers (closer-mop:method-specializers m))) | |
(if (typep (car specializers) 'closer-mop:eql-specializer) | |
(return-from has-class-method-p 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/bin/env python | |
import sys | |
import types | |
import operator | |
class Runtime: | |
def __init__(self, env={}, stack=[]): | |
self.env = { | |
# Primitive words, not an impressive base but it works |
OlderNewer