From 2b65675d6cfb2ccf332bbd1af59ee0cb704726a2 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 21 Dec 2018 15:07:31 -0800 Subject: [PATCH] don't do that --- pitfall/pitfall/document.rkt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pitfall/pitfall/document.rkt b/pitfall/pitfall/document.rkt index 01576b20..32329f76 100644 --- a/pitfall/pitfall/document.rkt +++ b/pitfall/pitfall/document.rkt @@ -27,8 +27,8 @@ [@ref-gen (generator () (let loop ([refid 1]) (yield refid) (loop (add1 refid))))] - [@root (ref 'Type "Catalog" - 'Pages (ref 'Type "Pages"))] ; top object + [@root (ref (mhasheq 'Type "Catalog" + 'Pages (ref (mhasheq 'Type "Pages"))))] ; top object [(@x x) 0] [(@y y) 0] [@info (mhasheq 'Producer "PITFALL" @@ -54,14 +54,8 @@ (define/public (page) (first @pages)) - (define/public (ref . args) + (define/public (ref [payload (mhasheq)]) (define refid (@ref-gen)) - (define payload (match args - [(list (? hash? h)) h] - [_ (define h (make-hasheq)) - (for ([pr (in-hash-pairs (apply hasheq args))]) - (hash-set! h (car pr) (cdr pr))) - h])) (define new-ref (make-object PDFReference this refid payload)) (set! @refs (cons new-ref @refs)) new-ref)