From 946b72c92408c59ac02d0f97d4e241a9098d742f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 1 Sep 2012 19:21:06 +0200 Subject: [PATCH] packages: Add a printer for . * guix/packages.scm (): Add record printer. --- guix/packages.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/guix/packages.scm b/guix/packages.scm index a1257b293f..0ecd4ca6d4 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -23,6 +23,7 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) + #:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:export (location @@ -164,6 +165,19 @@ representation." (default (and=> (current-source-location) source-properties->location)))) +(set-record-type-printer! + (lambda (package port) + (let ((loc (package-location package)) + (format simple-format)) + (format port "#" + (package-name package) + (package-version package) + (location-file loc) + (location-line loc) + (number->string (object-address + package) + 16))))) + ;; Error conditions.