Doc strings.
This commit is contained in:
parent
45ef5eddb4
commit
27dc152240
13
kutils.lisp
13
kutils.lisp
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
(in-package #:kutils)
|
(in-package #:kutils)
|
||||||
|
|
||||||
;;; "kutil" goes here. Hacks and glory await!
|
;;; "kutils" goes here. Hacks and glory await!
|
||||||
|
|
||||||
|
;;; This file contains various utilities I've written.
|
||||||
|
|
||||||
(defun join (x sep)
|
(defun join (x sep)
|
||||||
(flatten
|
(flatten
|
||||||
|
@ -50,6 +52,14 @@
|
||||||
m)))))
|
m)))))
|
||||||
|
|
||||||
(defun enable-hashtable-literal ()
|
(defun enable-hashtable-literal ()
|
||||||
|
"Enables the reader macro #{}# for hash-tables. The resulting
|
||||||
|
hash-table will use #'equal for equality. For example,
|
||||||
|
|
||||||
|
#{:a :b :c :d}#
|
||||||
|
|
||||||
|
will create a hash-table with the keys :a and :c. :a stores the
|
||||||
|
value :b, and :c stores the value :d.
|
||||||
|
"
|
||||||
(set-dispatch-macro-character
|
(set-dispatch-macro-character
|
||||||
#\# #\{ #'|#{-reader|))
|
#\# #\{ #'|#{-reader|))
|
||||||
|
|
||||||
|
@ -67,6 +77,7 @@
|
||||||
keys))
|
keys))
|
||||||
|
|
||||||
(defun hashtable-to-alist (m)
|
(defun hashtable-to-alist (m)
|
||||||
|
"Converts the hash-table given to an alist of (key . value) pairs."
|
||||||
(let ((alist '()))
|
(let ((alist '()))
|
||||||
(maphash (lambda (k v)
|
(maphash (lambda (k v)
|
||||||
(let ((elt (cons k v)))
|
(let ((elt (cons k v)))
|
||||||
|
|
Loading…
Reference in New Issue