Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-wadler-pprint Reference Manual, version 0.1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 04:18:16 2022 GMT+0.
• Introduction | What cl-wadler-pprint is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
An implementation of "A Prettier Printer" by Philip Wadler in Common Lisp.
(defclass foo ()
((bar :initarg :bar :reader bar)
(baz :initarg :baz :reader quux)))
(def-pretty-object foo ()
(bar baz))
; at width 80
(pretty t (make-instance 'foo :bar 1 :baz 2))
; #<FOO :BAR 1 :BAZ 2>
; at width 20
(pretty t (make-instance 'foo :bar 1 :baz 2))
; #<FOO :BAR 1
; :BAZ 2>
In my entrypoint (written in Java), I've got a method:
import java.io.IOException;
import java.util.Scanner;
import org.armedbear.lisp.JavaObject;
import org.armedbear.lisp.Packages;
public static void updateRightMargin() {
int rightMargin;
try {
Process proc = new ProcessBuilder("tput", "cols")
.inheritIO()
.redirectOutput(ProcessBuilder.Redirect.PIPE)
.start();
rightMargin = new Scanner(proc.getInputStream()).nextInt();
if(proc.waitFor() != 0) {
logError("Failed to update *PRINT-RIGHT-MARGIN*.");
return;
}
} catch(InterruptedException ex) {
logError("Failed to update *PRINT-RIGHT-MARGIN*: " + ex);
return;
} catch(IOException ex) {
logError("Failed to update *PRINT-RIGHT-MARGIN*: " + ex);
return;
}
Packages.findPackage("COMMON-LISP")
.findAccessibleSymbol("*PRINT-RIGHT-MARGIN*")
.setSymbolValue(JavaObject.getInstance(rightMargin, true));
}
and in main
, code like:
import sun.misc.Signal;
import sun.misc.SignalHandler;
Signal.handle(new Signal("WINCH"), new SignalHandler() {
public void handle(Signal sig) {
Main.updateRightMargin();
}
});
updateRightMargin();
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-wadler-pprint system |
Nathan Ringo <nathan@remexre.xyz>
Apache-2.0/MIT
An implementation of A Prettier Printer in Common Lisp.
0.1.0
cl-wadler-pprint.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cl-wadler-pprint.asd file | ||
• The cl-wadler-pprint/package.lisp file | ||
• The cl-wadler-pprint/wadler-pprint.lisp file |
Next: The cl-wadler-pprint/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-wadler-pprint.asd
cl-wadler-pprint (system)
Next: The cl-wadler-pprint/wadler-pprint․lisp file, Previous: The cl-wadler-pprint․asd file, Up: Lisp files [Contents][Index]
cl-wadler-pprint (system)
package.lisp
Previous: The cl-wadler-pprint/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
cl-wadler-pprint (system)
wadler-pprint.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The wadler-pprint package |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported functions | ||
• Exported generic functions | ||
• Exported structures |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
wadler-pprint.lisp (file)
Next: Exported generic functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
Pretty-prints a VALUE to the given STREAM, with the given WIDTH.
wadler-pprint.lisp (file)
Pretty-prints a DOCument to the given STREAM, with the given WIDTH.
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
Next: Exported structures, Previous: Exported functions, Up: Exported definitions [Contents][Index]
Converts an object to a document.
wadler-pprint.lisp (file)
Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
wadler-pprint.lisp (file)
structure-object (structure)
fixnum
(error "must provide width")
nest-width (function)
(setf nest-width) (function)
wadler-pprint::doc
(error "must provide doc")
nest-doc (function)
(setf nest-doc) (function)
wadler-pprint.lisp (file)
structure-object (structure)
string
(error "must provide string")
text-string (function)
(setf text-string) (function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions | ||
• Internal structures | ||
• Internal types |
Next: Internal structures, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
Returns whether the given value is a document.
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
Returns whether a given LAYOUT-DOC occupies no more than WIDTH bytes.
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
wadler-pprint.lisp (file)
Next: Internal types, Previous: Internal functions, Up: Internal definitions [Contents][Index]
wadler-pprint.lisp (file)
structure-object (structure)
wadler-pprint::doc
(error "must provide doc")
flatten-doc (function)
(setf flatten-doc) (function)
wadler-pprint.lisp (file)
structure-object (structure)
string
(error "must provide string")
newline-string (function)
(setf newline-string) (function)
wadler-pprint.lisp (file)
structure-object (structure)
wadler-pprint::doc
(error "must provide lhs")
union-doc-lhs (function)
(setf union-doc-lhs) (function)
wadler-pprint::doc
(error "must provide rhs")
union-doc-rhs (function)
(setf union-doc-rhs) (function)
Previous: Internal structures, Up: Internal definitions [Contents][Index]
An imprecise check for whether a value is a document.
wadler-pprint.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
B C D F G J M N P S T U |
---|
Jump to: | (
B C D F G J M N P S T U |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | D L R S W |
---|
Jump to: | D L R S W |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C D F N P S T U W |
---|
Jump to: | C D F N P S T U W |
---|