;;; -*- mode: Lisp; Syntax: Common-Lisp; -*- ;;; ;;; Copyright (c) 2009 by the authors. ;;; ;;; See LICENCE for details. (in-package :hu.dwim.projectional-editor) ;;;;;;; ;;; Printer API (def (generic e) print-to-device (document device) (:documentation "Prints DOCUMENT to a single DEVICE. Has side effects on DEVICE.")) (def (namespace e) printer) (def (definer e) printer (name arguments &body forms) `(setf (find-printer ',name) (lambda ,arguments ,@forms))) ;;;;;; ;;; Printer API implementation (def method print-to-device (document (device device/input)) ;; NOTE: continue if DEVICE is also an output device, otherwise do nothing (if (output-device? device) (call-next-method) (values)))