From 50df49d6fabb8528b220db19f321d99766b3b43d Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 19 Mar 2015 19:08:03 -0700 Subject: [PATCH] resume here --- quad/measure-typed.rkt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quad/measure-typed.rkt b/quad/measure-typed.rkt index 7d874dfe..9321cab4 100644 --- a/quad/measure-typed.rkt +++ b/quad/measure-typed.rkt @@ -1,5 +1,6 @@ #lang typed/racket/base -(require typed/racket/class) +(require (for-syntax typed/racket/base )) +(require typed/racket/class math/flonum racket/list racket/file) (require/typed racket/draw [record-dc% (Class (init-field) (get-text-extent (String (Instance (Class (init-field))) Any . -> . (values Nonnegative-Real Nonnegative-Real Nonnegative-Real Nonnegative-Real))))] @@ -7,7 +8,6 @@ (require/typed sugar/cache [make-caching-proc (Procedure . -> . Procedure)]) (require/typed racket/serialize [serialize (Any . -> . Any)] [deserialize (Any . -> . (HashTable Any Any))]) -(require math/flonum racket/list (only-in sugar/list values->list) racket/file) (provide measure-text measure-ascent round-float update-text-cache-file load-text-cache-file make-font/caching) (define precision 4.0) @@ -16,6 +16,9 @@ (define-syntax-rule (round-float x) (fl/ (flround (fl* base (fl x))) base)) +(define-syntax (values->list stx) + (syntax-case stx () + [(_ values-expr) #'(call-with-values (λ () values-expr) list)])) (define dc (new record-dc%))