kevinlivingston <kevinlivingston@gmail.com> wrote:
+---------------
| While I don't use all of it all of the time I do seem to use quite a
| bit, and it's nice to have learned one language that has most of what
| I need most of the time.
+---------------
Yes, indeed!
+---------------
| I think a more interesting "survey question" would be what do you find
| yourself reimplementing over and over that's not already in there?
+---------------
My standard utilities package:
(defpackage :org.rpw3.utils
(:nicknames :utils)
(:use :cl :ext)
(:export
;; Readmacros:
#:set-sharp-bang-reader ; Enable #! as a comment (for shell scripts).
#:set-sharp-dollar-reader ; Experimental LAMBDA abbreviation [c.f. FN].
#:set-zero-x-reader ; C-style hex numbers, e.g. 0x1234. [BUGGY!]
;; Macros:
#:deflex ; "Global lexical variables" (sort of).
#:fn ; Alias for LAMBDA.
#:dbgv ; Debug printing of forms & values.
#:dbgvht ; Same, but outputs as HTML.
#:with-output-to-file ; Save typing in the most common output case.
;; String-hacking functions:
#:getenv ; Portable version.
#:strcat ; Syntactic sugar [with a compiler macro, too].
#:join-strings ; STRCAT with infix separators.
#:join-strings/sql-quoted ; JOIN-STRINGS with SQL-quoting of some chars.
#:stringify ; Coerce items in atom/list/tree to strings.
#:file-string ; Suck up a whole file into a string.
#:file-lines ; ...into a list of strings (lines).
#:file-forms ; ...into a list of forms (s-exprs).
#:stream-string ; Same as above, but for an open stream
#:stream-lines
#:stream-forms
#:\0x ; A FORMAT printer for hex, e.g. "~2/0x/".
;; Time-formatters [see also CMUCL's EXT:FORMAT-UNIVERSAL-TIME]:
#:format-time-ctime
#:format-time-iso8601
;; Misc. other
#:iota ; (count &optional (start 0) (step 1))
#:mean
#:median
#:std-dev
;; CMUCL MP convenience functions for servers that leave a REPL running:
#:ensure-idle-process-running ; Initial REPL -> idle proc; new proc -> REPL.
#:restart-top-level ; If accidentally kill REPL proc.
#:break-top-level ; Recover from certain tricky typos.
))
And some support for web hacking:
(defpackage :org.rpw3.cgi.uri
(:nicknames :uri)
(:use :cl :ext :htout :utils)
(:export
;; Functions
#:read/parse-http-request
#:query-string-alist
#:cgi-lookup
#:cgi-lookup-all
#:request-env
#:request-binding
#:split-path
#:extract/trim-bindings
#:match-query/bindings
#:match-assoc
#:build-continuation
#:decode-hex
#:url-decode
#:register-uri-handler
#:find-uri-handler
#:not-found-page
#:forbidden-page
#:fallback-page
#:internal-error-page
#:list-html-table
;; Structures
#:http-request
#:http-server
#:uri-handler
...[and friends]...
...[other misc.]...
))
-Rob
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607