@code{sb-ext:*posix-argv*}. The UNIX environment can be queried with
the @code{sb-ext:posix-getenv} function.
+@include fun-sb-ext-posix-getenv.texinfo
+
The SBCL system can be terminated with @code{sb-ext:quit}, (but see
-notes above about threads and sessions) optionally returning a
-specified numeric value to the calling Unix process. The normal Unix
-idiom of terminating on end of file on input is also supported.
+notes in @ref{Threading} about the interaction between this feature and
+sessions) optionally returning a specified numeric value to the
+calling Unix process. The normal Unix idiom of terminating on end of
+file on input is also supported.
+@include fun-sb-ext-quit.texinfo
@node Customization Hooks for Users, Tools To Help Developers, Support For Unix, Extensions
@comment node-name, next, previous, up
between multiple Lisp processes. it is less important with modern
generational garbage collectors.
-@code{sb-ext:truly-the} declaration declares the type of the result of
-the operations, producing its argument; the declaration is not
+@include fun-sb-ext-purify.texinfo
+
+@code{sb-ext:truly-the} special form declares the type of the result
+of the operations, producing its argument; the declaration is not
checked. In short: don't use it.
+@include special-operator-sb-ext-truly-the.texinfo
+
The @code{sb-ext:freeze-type} declaration declares that a
type will never change, which can make type testing
(@code{typep}, etc.) more efficient for structure types.
(when docs (setf result (nconc docs result)))))
(when package-doc
(setf result (nconc (list (list (intern (package-name package) :keyword)
- 'package package-doc)) result)))))
+ 'package package-doc)) result)))
+ result))
;;; Helpers for texinfo output
(subseq name (1+ index))))))
name))
-(defun unique-name (symbol kind)
+(defun unique-name (symbol package kind)
(nstring-downcase
(format nil "~A-~A-~A"
(ecase kind
(compiler-macro "compiler-macro")
- (function (if (macro-function symbol)
- "macro"
- "fun"))
+ (function (cond
+ ((macro-function symbol) "macro")
+ ((special-operator-p symbol) "special-operator")
+ (t "fun")))
(method-combination "method-combination")
(package "package")
(setf "setf-expander")
(structure-class "struct")
(standard-class "class")
(sb-pcl::condition-class "condition")
- (null "type"))))
+ ((or built-in-class null) "type"))))
(variable (if (constantp symbol)
"constant"
"var")))
- (package-name (symbol-package symbol))
- (alphanumize symbol)
- )))
+ (package-name package)
+ (alphanumize symbol))))
(defun def-begin (symbol kind)
(ecase kind
(compiler-macro "@deffn {Compiler Macro}")
- (function (if (macro-function symbol)
- "@defmac"
- "@defun"))
+ (function (cond
+ ((macro-function symbol) "@defmac")
+ ((special-operator-p symbol) "@defspec")
+ (t "@defun")))
(method-combination "@deffn {Method Combination}")
(package "@deffn Package")
(setf "@deffn {Setf Expander}")
(structure-class "@deftp Structure")
(standard-class "@deftp Class")
(sb-pcl::condition-class "@deftp Condition")
- (null "@deftp Type"))))
+ ((or built-in-class null) "@deftp Type"))))
(variable (if (constantp symbol)
"@defvr Constant"
"@defvar"))))
(defun def-end (symbol kind)
(ecase kind
(compiler-macro "@end deffn")
- (function (if (macro-function symbol)
- "@end defmac"
- "@end defun"))
+ (function (cond
+ ((macro-function symbol) "@end defmac")
+ ((special-operator-p symbol) "@end defspec")
+ (t "@end defun")))
(method-combination "@end deffn")
(package "@end deffn")
(setf "@end deffn")
:if-does-not-exist :create :if-exists :supersede)
(loop for (symbol kind docstring) in docs
do (format out "~&@anchor{~A}~%~A ~A~@[ ~A~]~%~A~%~A~%~%"
- (unique-name symbol kind)
+ (unique-name symbol package kind)
(def-begin symbol kind)
(texinfoify symbol)
(def-rest symbol kind)
(loop
with docs = (collect-documentation (find-package package))
for (symbol kind docstring) in docs
- for doc-identifier = (unique-name symbol kind)
+ for doc-identifier = (unique-name symbol package kind)
do (with-open-file (out
(merge-pathnames
(make-pathname :name doc-identifier :type "texinfo")
:direction :output
:if-does-not-exist :create :if-exists :supersede)
(format out "~&@anchor{~A}~%~A ~A~@[ ~A~]~%~A~%~A~%~%"
- (unique-name symbol kind)
+ (unique-name symbol package kind)
(def-begin symbol kind)
(texinfoify symbol)
(def-rest symbol kind)