Permalink
Browse files

rename to newlisp-mode.el

repository "newlisp-files" was renamed to "newlisp-mode.el".

the other files (manual.txt, etc) was moved to another repositories.
see README.
  • Loading branch information...
1 parent adbc096 commit 82d877d250dce7547e281fc060887c0aac011f8c @kosh04 committed Jun 4, 2013
Showing with 11 additions and 21,090 deletions.
  1. +1 −0 .gitignore
  2. +10 −45 README.md
  3. +0 −182 init.lsp
  4. 0 newlisp.el → newlisp-mode.el
  5. +0 −20,167 newlisp_manual.txt
  6. +0 −686 swank-newlisp.lsp
  7. +0 −10 swank-newlisp.sh
View
@@ -0,0 +1 @@
+*.elc
View
@@ -1,27 +1,6 @@
-newLISP utility files
-=====================
+newlisp-mode.el
+===============
-LISP風軽量スクリプト言語newLISPのユーティリティファイル群です。
-
-newLISP Home - <http://www.newlisp.org/>
-
-> newLISP is a Lisp-like, general-purpose scripting language. It has all
-the magic of traditional Lisp but is easier to learn and use. newLISP is
-friendly, fast, and small. Most of the functions you will ever need are
-already built in. newLISP runs on most OS platforms.
-
-
-init.lsp
---------
-My newlisp initialization file.
-
-* Other snippet, see below:
-
- <https://github.com/kosh04/newlisp.snippet>
-
-
-newlisp.el
-----------
newLISP editing mode for Emacs.
- Editing newlisp code
@@ -33,28 +12,14 @@ newLISP editing mode for Emacs.
[*] primitive keyword only.
-newlisp_manual.txt (v.10.3.2)
------------------------------------
-Text file converted from newlisp html document.
-
-newlisp.el と組み合わせて利用します。
-ブラウザで開くと非常に重いので、一旦ローカルに落とす方が良いです。
-
-`wget http://github.com/kosh04/newlisp-files/raw/master/newlisp_manual.txt`
-
-- newLISP Manual and Reference
-
- <http://www.newlisp.org/downloads/newlisp_manual.html>
-
-- newLISP Manual and Reference [ja]
-
- <http://www.newlisp.org/newlisp_manual-jp.html>
-
+Others
+------
-swank-newlisp.lsp
------------------
-Swank server for newLISP.
+- newlisp_manual.txt
+ moved to http://dl.dropbox.com/u/78796224/newlisp/newlisp_manual.txt
-What is SLIME? - <http://common-lisp.net/project/slime/>
+- init.lsp
+ moved to https://github.com/kosh04/newlisp.snippet
-* swank-newlisp.sh - swank server startup wrapper
+- Swank server for newLISP
+ moved to https://github.com/kosh04/swank-newlisp
View
182 init.lsp
@@ -1,182 +0,0 @@
-;;; init.lsp -*- encoding: utf-8 -*-
-
-;; TODO:
-;; * newLISPコテコテの関数を使うべきか、なるべくLISP準拠にするべきか
-
-;; NOTE:
-;; 他のライブラリが再定義する可能性があるので
-;; 以下は極力ここでは利用しないこと
-;; * 定数
-;; * Context
-
-(define (apropos str (do-print true))
- "Return symbols that matches the regexp."
- (let ((acc (find-all str (symbols) $it
- (lambda (x y)
- (regex x (name y))))))
- (when (and acc do-print)
- (dolist (item acc)
- (cond
- ((primitive? (eval item))
- (println item "\t" "<primitive>"))
- ((lambda? (eval item))
- (println item "\t" "<lambda>"))
- ((macro? (eval item))
- (println item "\t" "<macro>"))
- ("else"
- (println item)))))
- acc))
-
-(define (use libname)
- (load (or (exists file?
- (list
- libname
- (append (env "NEWLISPDIR") "/modules/" libname)
- (append (env "HOME") "/share/newlisp/modules/" libname)
- ))
- (throw-error (list "No such module" libname)))))
-
-(define (load-guiserver (nomsg nil))
- (unless nomsg (print "loading guiserver..."))
- (load (append (env "NEWLISPDIR") "/guiserver.lsp"))
- (gs:init)
- (unless nomsg (print "done."))
- true)
-
-;; @syntax (aif test then [else])
-(define-macro (aif)
- "anaphoric if"
- (let (it (eval (args 0)))
- (if it
- (eval (args 1))
- (eval (cons 'begin (2 (args)))))))
-
-(define top-level (lambda () (reset nil)))
-(define restart (lambda () (reset true)))
-
-(define (utf8?)
- "Non-nil means newLISP is UTF-8 eoncoding are supported."
- (primitive? MAIN:utf8))
-
-(define (newlisp-version)
- "Return newLISP version as integer."
- (sys-info -2))
-
-(define (getpid) (sys-info -3)) ; Return the Process ID of newLISP.
-(define (getppid) (sys-info -4))
-;; (import "libc.so.6" "getpid")
-;; こっちは[parent-pid]sh or emacs -> [child-pid]newlisp
-;; (import "libc.so.6" "getppid")
-
-;; see newlisp.h
-(define COMPARE_TYPE_MASK 0x000F)
-(define type-of:types
- '("bool" "bool" "integer" "float" "string"
- "symbol" "context" "primitive" "cdecl" "stdcall"
- "quote" "list" "lambda" "macro" "array"))
-(define (type-of:type-of x)
- (type-of:types (& COMPARE_TYPE_MASK ((dump x) 1))))
-
-;; simple loop
-(define-macro (loop)
- (let ((return throw))
- (catch (while true (map eval (args))))))
-
-;; (define (printf) (print (apply format (args))))
-(case ostype
- ("Win32"
- (import "msvcrt.dll" "printf")
- (import "msvcrt.dll" "fflush"))
- ("Linux"
- (import "libc.so.6" "printf")
- (import "libc.so.6" "fflush")))
-
-;; treat integer operators (+-*/) as float operators (add sub mul div).
-;(constant '+ add '- sub '* mul '/ div)
-
-(define array->list array-list)
-
-(define (perm seq n)
- "SEQから重複なしでランダムにN個の要素を選択する."
- (let ((len (length seq)))
- (slice (if (empty? seq)
- seq
- (select seq (randomize (sequence 0 (- len 1)))))
- 0 (or n len))))
-;(perm "newLISP") => "LSwePIn"
-
-(define (error)
- (throw-error (apply format (args))))
-
-(define (errno)
- (nth 0 (sys-error)))
-
-(define (curl url) (print (get-url url)) true)
-(define (curl--head url) (print (get-url url "header")) true)
-(define curl-I curl--head)
-;; (curl--head "http://www.newlisp.org/")
-
-(define nslookup net-lookup)
-
-(define (shell-command-to-string str-process)
- (join (exec str-process) "\n"))
-
-;; destructuring-bind like
-;; syntax: (mapset <lambda-list> <expr> <form*>)
-(define-macro (mapset)
- (eval (list 'local (args 0)
- (list 'map 'set (list 'quote (args 0)) (args 1))
- (cons 'begin (2 (args))))))
-;; (setf (get 'mapset 'lisp-indent-function) 2)
-
-(define (xml-parse-file file xml-option)
- (xml-type-tags nil nil nil nil) ; or (nil cdata !-- nil)
- (xml-parse (read-file file) (or xml-option (+ 1 2 4))))
-
-(define (%get-string addr (n 100))
- "ADDRを配列のポインタとみなしてNバイト分読み込む."
- (first (unpack (string "s" n) addr)))
-
-;; (expand-env "HOME=$HOME") => "HOME=/home/username"
-;; FIXME: "${HOME}"
-(define (expand-env str)
- (dolist (e (env))
- (replace (string "$" (e 0)) str (e 1)))
- str)
-
-;; see `man ascii'
-(setq escape-char-name
- '("NUL" "SOH" "STX" "ETX" "EOT" "ENQ" "ACK" "BEL" "BS" "HT"
- "LF" "VT" "FF" "CR" "SO" "SI" "DLE" "DC1" "DC2" "DC3" "DC4"
- "NAK" "SYN" "ETB" "CAN" "EM" "SUB" "ESC" "FSGS" "RS" "US" "SPACE"))
-
-
-(use "io.lsp")
-(use "files.lsp")
-(use "regex.lsp")
-(use "net.lsp")
-(use "argv.lsp")
-(use "arglist.lsp")
-;(use "legacy.lsp")
-;(use "iconv.lsp")
-(use "cl.lsp")
-(if (= ostype "Win32")
- (use "winapi.lsp"))
-
-;; (prompt-event (fn (ctx) (string ctx ":" (real-path) "> ")))
-
-(unless (getopt "-q")
- (println "init.lsp loading...done")
- (println "current working directory: " (pwd)))
-
-(let ((e (env "NEWLISPDIR")))
- (when (and e (not (directory? e)))
- (println "warning: directory " e " not found.")))
-
-;; 起動時に引数指定でモジュールを読み込む
-;; $ newlisp -use FILENAME.lsp
-(aif (getopt "-use" true) (use it))
-
-(context MAIN)
-
-;;; init.lsp ends here
File renamed without changes.
Oops, something went wrong.

0 comments on commit 82d877d

Please sign in to comment.