Skip to content

Instantly share code, notes, and snippets.

View kosh04's full-sized avatar
🎧

KOBAYASHI Shigeru kosh04

🎧
View GitHub Profile
;;; eldoc.el --- show function arglist or variable docstring in echo area
;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007 Free Software Foundation, Inc.
;; Copyright (C) 2009 KOBAYASHI Shigeru <shigeru.kb@gmail.com>
;; Author: Noah Friedman <friedman@splode.com>
;; Maintainer: friedman@splode.com
;; Keywords: extensions
@kosh04
kosh04 / gist:255040
Created December 12, 2009 20:24
256colors2.lsp
#!/usr/bin/newlisp
# original source:
# http://frexx.de/xterm-256-notes/data/256colors2.pl
;; FIXME:
; (define (printf) (print (apply format (args))))
; current newLISP `format' function cannot use. (v.10.1.7)
; (format "%2.2x" 0) => ERR
;
@kosh04
kosh04 / mandelbrot.lsp
Created December 20, 2009 02:54
Mandelbrot Set ASCII art for newLISP
#!/usr/bin/env newlisp
;;; Mandelbrot Set ASCII art (tested newLISP v.10.3.0)
;;; Original: (Common Lisp)
;; - http://groups.google.com/group/comp.lang.lisp/msg/d786bbde308e8175
;; - http://bc.tech.coop/blog/040811.html
;;; Usage:
;; $ ./mandelbrot.lsp
;; lambda.lsp - newLISPでラムダ計算をしてみるテスト
;; newLISPの以下の性質を利用することで、動的束縛を静的束縛のように振舞わせる
;; * 読取器が大文字小文字を区別すること
;; * ラムダ式がオープン(リストのサブタイプ)であり、変更が容易なこと
;; * 大文字から始まるシンボルを展開する関数(expand)が用意されている
;; 当然ながら、変数が重複するとシンボルの展開がおかしくなるのでエラー
;; 場合によってはラムダ式の仮引数が展開されて妙なことに (しかもエラーの通知がない)
@kosh04
kosh04 / gist:272876
Created January 9, 2010 12:45
file(1) wrapper, for newLISP
;; @module libmagic.lsp
;; @description determine file type (use magic library)
;; @author KOBAYASHI Shigeru (kosh) <shigeru.kb@gmail.com>
;; @version 0.2
;;; Usage:
;; (load "libmagic.lsp")
;; (Magic:magic-file "libmagic.lsp")
;; => "Lisp/Scheme program text"
;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
;;; Package Management
(in-package :cl-user)
(defpackage :hige
(:use :cl
:drakma
:cl-ppcre)
#+ABCL (:shadow :y-or-n-p)
#!/usr/bin/sbcl --script
;;; Usage:
;;
;; $ sbcl --script play.lisp --play hige:pon
;; or
;; $ clisp play --play hige:pon
(require :asdf)
(push (merge-pathnames "code/lisp/drakma-1.1.0/" (user-homedir-pathname)) asdf:*central-registry*)
#!/usr/bin/newlisp
;; 第1回 Scheme コードバトン (newLISP fork)
;;
;; ■ これは何か?
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。
;; 次回 Shibuya.lisp で成果を発表します。
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。
;;
;; ■ 2 つのルール
@kosh04
kosh04 / lispkwd.l
Created January 30, 2010 06:39
xyzzy lispの基本的な色付け
#|
;; lispkwd.l
;; ■参考リンク
;; Lisp でキーワードの色付け (キーワードファイルは ~/etc/lisp)
;; http://hie.s64.xrea.com/xyzzy/note/major_mode.html#lisp-mode
;; xyzzy Lisp のシンボルテーブルは大文字小文字を区別するが
;; Common Lisp はデフォルトでは setq/SETQ のように大文字小文字を区別しない.
;; newLISP v.10.1.12 on Linux IPv4 UTF-8, execute 'newlisp -h' for more info.
;;; *** Load from Network
;;
;; (context 'Foo)
;; (load "http://gist.github.com/362201.txt")
;; (println "Context: " (context))
;; -> Context: MAIN
;;; *** Load from Filesystem