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: user -*- | |
#| | |
使い方(暫定): | |
1. どこかへ framework.l と nanri-master-change-tests.l をダウンロード | |
2. M-x load-file | |
load file: path/to/framework.l | |
3. M-x load-test-file | |
test file: path/to/nanri-master-change-tests.l | |
4. M-x change-tests |
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
#!/bin/ruby | |
require 'Win32API' | |
module Cygwin | |
# cygwin環境であればtrue | |
def cygwin? | |
RUBY_PLATFORM =~ /-cygwin$/ | |
end | |
# TODO コロン(:)などwindowsでファイル名に使えない文字が名前に入ってるファイルをうまく変換できません助けて! | |
# http://www.ruby-lang.org/ja/old-man/html/Win32API.html | |
PATH_TO_WIN32_FULL = Win32API.new('cygwin1.dll', 'cygwin_conv_to_full_win32_path', 'PP', 'I') |
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
#| | |
Gauche の c-wrapper のように C のソースから直接 FFI の定義を生成するマクロ。 | |
まだ、関数と構造体と列挙型だけ。 | |
(c:define-c-type (winapi:BYTE *) LPBYTE) | |
(define-c-struct-wrapper " | |
typedef struct _PROCESS_INFORMATION { | |
HANDLE hProcess; // プロセスのハンドル | |
HANDLE hThread; // プライマリスレッドのハンドル |
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
--- compile.l 2002-03-25 02:49:18 +0900 | |
+++ compile_fix.l 2011-05-31 22:48:44 +0900 | |
@@ -649,6 +649,10 @@ | |
(defun compile-call (form) | |
(let ((f (assoc (car form) *macro-environment* :test #'eq))) | |
(cond ((null f) | |
+ (when (and (consp (car form)) | |
+ (eq 'lambda (caar form))) | |
+ (format t "~&calling lambda form: ~S~%" form) | |
+ (push 'funcall form)) |
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
--- compile.l 2002-03-25 02:49:18 +0900 | |
+++ compile_fix.l 2011-05-31 16:17:04 +0900 | |
@@ -649,6 +649,9 @@ | |
(defun compile-call (form) | |
(let ((f (assoc (car form) *macro-environment* :test #'eq))) | |
(cond ((null f) | |
+ (when (and (consp (car form)) | |
+ (eq (caar form) 'lambda)) | |
+ (push 'funcall form)) | |
(dolist (f (cdr form)) |
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
;; 以下のコードで si:unpack-string の時点で xyzzy がクラッシュする。 | |
;; | |
;; - offset を指定しない場合や nil の場合はクラッシュしない | |
;; - offset の値は何でもいい | |
;; | |
;; offset を指定された場合に chunk が nil の場合は、si:make-chunk の時点でエラーにするように | |
;; 引数をチェックするとかかな。 | |
(let ((chunk nil) | |
(offset 100)) |
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
;; xl-critic でバイトコンパイルするとエラーになる原因は | |
;; destructuring-bind 内で使っている lambda マクロが原因? | |
;; clisp だと動くので xyzzy のどっかのバグ? | |
(defun test1 () | |
(let ((a 1)) | |
((lambda () a)))) | |
;=> test1 | |
(test1) | |
;=> 1 |
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
(defpackage :infix | |
(:use :cl) | |
(:export #:add-operator | |
#:add-infix-function | |
#:install-default-operators-and-infix-functions)) | |
(in-package :infix) | |
(defconstant default-operators | |
'((1 ** expt :right) |
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: https://gist.github.com/784338 | |
;;; http://d.hatena.ne.jp/athos/20110119/p1 | |
(defmacro w/uniq (names &body body) | |
(let ((binds (mapcar #'(lambda (s) `(,s (make-symbol ,(symbol-name s)))) | |
(if (consp names) names (list names))))) | |
`(let ,binds ,@body))) | |
(defmacro defun-tc (name arglist . body) | |
(when (find-if (lambda (s) (find s '(&key &allow-other-keys &aux))) arglist) |
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
lisp_object { | |
preview ( | |
#if (&$e == Qnil) ("nil") #else ( | |
#if (&$e == Qunbound) ("unbound") #else ( | |
#if (((unsigned)&$e) & 0x01) ( #( | |
#if (((unsigned)&$e) & 0x10) ( #( | |
[((unsigned)&$e) >> 0x10, hx], " ", | |
#switch (((unsigned)&$e) & 0xffff) | |
#case 0x04 ( "Tchar" ) | |
#case 0x08 ( "Tmessage" ) |
NewerOlder