Skip to content

Instantly share code, notes, and snippets.

@cametan001
Created May 8, 2010 02:46
Show Gist options
  • Select an option

  • Save cametan001/394269 to your computer and use it in GitHub Desktop.

Select an option

Save cametan001/394269 to your computer and use it in GitHub Desktop.
;; hello-system 「自体で」 :p-n-f パッケージが要り用になるわけではない事に注意
(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")))
;; 外部システムへの依存は :components 内ではなく、その外側の :depends-on で指定する
;; 実際にここで指定してるのはシステムそのものではなく、外部システムの asd である
:depends-on ("p-n-f"))
(in-package #:hello)
(print-name-of-function "Hello, World!")
(in-package :cl-user)
(defpackage :hello
(:use :common-lisp :p-n-f) ;パッケージ p-n-f も使用するように指定する
(:export :hello-world))
; loading system definition from /home/cametan/hello.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM HELLO {B3DF161}> as HELLO
; loading system definition from /home/cametan/hello.asd into
; #<PACKAGE "ASDF0">
; loading system definition from /home/cametan/p-n-f.asd into
; #<PACKAGE "ASDF0">
; registering #<SYSTEM P-N-F {AD9A771}> as P-N-F
; compiling file "/home/cametan/hello/packages.lisp" (written 08 MAY 2010 11:33:31 AM):
; compiling (IN-PACKAGE :CL-USER)
; compiling (DEFPACKAGE :HELLO ...)
; /var/cache/common-lisp-controller/1000/sbcl/local/home/cametan/hello/packages.fasl written
; compilation finished in 0:00:00.114
; compiling file "/home/cametan/hello/hello-world.lisp" (written 08 MAY 2010 11:35:41 AM):
; compiling (IN-PACKAGE #:HELLO)
; compiling (PRINT-NAME-OF-FUNCTION "Hello, World!")
; /var/cache/common-lisp-controller/1000/sbcl/local/home/cametan/hello/hello-world.fasl written
; compilation finished in 0:00:00.003
CL-USER> (use-package :hello)
T
CL-USER> (hello-world)
Hello, World!
"Hello, World!"
CL-USER> (symbol-package 'hello-world)
#<PACKAGE "HELLO">
CL-USER> (symbol-function 'hello-world)
#<FUNCTION HELLO-WORLD>
CL-USER>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment