Created
May 6, 2010 20:59
-
-
Save cametan001/392698 to your computer and use it in GitHub Desktop.
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
CL-USER> (asdf:operate 'asdf:load-op :hello) | |
; loading system definition from /home/cametan/hello.asd into | |
; #<PACKAGE "ASDF0"> | |
; registering #<SYSTEM HELLO {AB3F071}> as HELLO | |
NIL | |
CL-USER> |
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
(in-package #:hello) | |
(defun hello-world () | |
(princ *h*)) |
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
(in-package #:hello) | |
(defun hello-world () | |
(princ "Hello, World!")) |
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 :hello-system (:use :asdf :cl)) | |
(in-package :hello-system) | |
(defsystem hello | |
:name "hello" | |
:author "" | |
:version "" | |
:maintainer "" | |
:licence "" | |
:description "" | |
:long-description "" | |
:components | |
((:file "packages") | |
(:file "hello-world" :depends-on ("packages")))) ;hello-world.lisp は packages.lisp に依存 |
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 :京都 (:use :cl :大阪)) ; cl の他に大阪パッケージを use するように指定 | |
#<PACKAGE "京都"> | |
東京> (in-package :京都) ;京都へ移動 | |
#<PACKAGE "京都"> | |
京都> 支店長 ;大阪からエクスポートされた全シンボルは京都パッケージに共有される | |
1 | |
京都> (symbol-package '支店長) ;京都の支店長は大阪の支店長であることが分かる | |
#<PACKAGE "大阪"> | |
京都> |
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
(in-package :cl-user) | |
(defpackage :hello | |
(:use :common-lisp) | |
(:export :hello-world)) |
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
(in-package #:hello) | |
(defparameter *h* "Hello, World!") |
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
(in-package :cl-user) | |
(defpackage :パッケージ名 | |
(:use :common-lisp) ; common-lisp 以外でも使いたいパッケージがあれば指定 | |
;; (:export :プログラムファイル内で使ってるエクスポートしたいシンボル名 | |
;; :複数列挙化) | |
) |
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 :システムパッケージ名 (:use :asdf :cl)) ;システムパッケージを定義 | |
(in-package :システムパッケージ名) ;システムパッケージへ移動 | |
(defsystem システム名 | |
:name "システム名" ;システム名表示 | |
:author "" ;著作者名表示 | |
:version "" ;ヴァージョン番号表示 | |
:maintainer "" ;メンテナ名表示 | |
:licence "" ;ライセンス表示 | |
:description "" ;短い解説表示 | |
:long-description "" ;詳細な解説表示 | |
:components ;システム内のファイル設定 | |
((:file "packages") ;packages.lisp の読み込み | |
(:file "" :depends-on ("packages")) ;プログラム本体ファイルの読み込み( packages.lisp に依存) | |
;; 複数列挙可 | |
) | |
;; :depends-on () ;依存する外部システム | |
) |
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
CL-USER> (use-package :hello) | |
T | |
CL-USER> (hello-world) | |
Hello, World! | |
"Hello, World!" | |
CL-USER> (symbol-package 'hello-world) | |
#<PACKAGE "HELLO"> | |
CL-USER> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment