# HG changeset patch # User Steve Losh # Date 1471913149 0 # Node ID b6b6000308ea3b7a344cdcf07f4eb4d87cbbb65c # Parent 768bd70efb57c9d5b55f4057c61e47a0e2f66926 Remove `slurp` and `spit` They duplicate Alexandria's `read-file-into-string` and `write-string-into-file`. diff -r 768bd70efb57 -r b6b6000308ea DOCUMENTATION.markdown --- a/DOCUMENTATION.markdown Mon Aug 22 20:36:47 2016 +0000 +++ b/DOCUMENTATION.markdown Tue Aug 23 00:45:49 2016 +0000 @@ -317,23 +317,6 @@ (DLAMBDA &REST CLAUSES) -## Package `LOSH.FILE-IO` - -Utilities for reading from and writing to files. - -### `SLURP` (function) - - (SLURP PATH) - -Sucks up an entire file from PATH into a freshly-allocated string, - returning two values: the string and the number of bytes read. - -### `SPIT` (function) - - (SPIT PATH STR) - -Spit the string into a file at the given path. - ## Package `LOSH.FUNCTIONS` Utilities for working with higher-order functions. diff -r 768bd70efb57 -r b6b6000308ea losh.lisp --- a/losh.lisp Mon Aug 22 20:36:47 2016 +0000 +++ b/losh.lisp Tue Aug 23 00:45:49 2016 +0000 @@ -1166,21 +1166,6 @@ ,@body))))) -;;;; File IO -(defun slurp (path) - "Sucks up an entire file from PATH into a freshly-allocated string, - returning two values: the string and the number of bytes read." - (with-open-file (s path) - (let* ((len (file-length s)) - (data (make-string len))) - (values data (read-sequence data s))))) - -(defun spit (path str) - "Spit the string into a file at the given path." - (with-open-file (s path :direction :output :if-exists :supersede) - (format s "~A" str))) - - ;;;; Weightlists (defstruct (weightlist (:constructor %make-weightlist)) weights sums items total) diff -r 768bd70efb57 -r b6b6000308ea make-docs.lisp --- a/make-docs.lisp Mon Aug 22 20:36:47 2016 +0000 +++ b/make-docs.lisp Tue Aug 23 00:45:49 2016 +0000 @@ -8,7 +8,6 @@ "LOSH.DEBUGGING" "LOSH.DISTRIBUTIONS" "LOSH.ELDRITCH-HORRORS" - "LOSH.FILE-IO" "LOSH.FUNCTIONS" "LOSH.HASH-SETS" "LOSH.ITERATE" diff -r 768bd70efb57 -r b6b6000308ea package.lisp --- a/package.lisp Mon Aug 22 20:36:47 2016 +0000 +++ b/package.lisp Tue Aug 23 00:45:49 2016 +0000 @@ -163,12 +163,6 @@ #:bits #:dis)) -(defsubpackage #:losh.file-io - (:documentation "Utilities for reading from and writing to files.") - (:export - #:slurp - #:spit)) - (defsubpackage #:losh.weightlists (:documentation "A simple data structure for choosing random items with weighted probabilities.")