dev-refac-2020
Matthew Butterick 6 years ago
parent 5fb1d5f633
commit b22b907663

@ -1,5 +1,8 @@
#lang racket/base #lang racket/base
(require racket/class (for-syntax racket/base racket/syntax) racket/dict) (require (for-syntax racket/base racket/syntax)
racket/class
racket/promise
racket/dict)
(provide (all-defined-out)) (provide (all-defined-out))
@ -44,7 +47,7 @@
(define ·-helper (define ·-helper
(procedure-rename (procedure-rename
(λ (x . refs) (λ (x . refs)
(for/fold ([x x]) (for/fold ([x (force x)])
([ref (in-list refs)] ([ref (in-list refs)]
#:break (not x)) #:break (not x))
(cond (cond
@ -83,7 +86,7 @@
(field [foo 'field]) (field [foo 'field])
(define/public (bar) 'method) (define/public (bar) 'method)
(define/public (zam) (hasheq 'zoom 'hash)))) (define/public (zam) (hasheq 'zoom 'hash))))
(define h (hasheq 'bam (new C) 'foo 'hashlet)) (define h (delay (hasheq 'bam (new C) 'foo 'hashlet)))
(define o (new C)) (define o (new C))
(check-equal? (· o foo) 'field) (check-equal? (· o foo) 'field)
(check-equal? (· o bar) 'method) (check-equal? (· o bar) 'method)

Loading…
Cancel
Save