www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

test-structure-speed.rkt (709B)


      1 #lang typed/racket/base
      2 
      3 (require phc-adt
      4          phc-toolkit
      5          type-expander
      6          typed/rackunit
      7          (for-syntax racket/base
      8                      syntax/stx
      9                      racket/list))
     10 (adt-init)
     11 
     12 (define-syntax (repeat-stx stx)
     13   (syntax-case stx ()
     14     [(_ n expr)
     15      (number? (syntax-e #'n))
     16      #`(begin . #,(stx-map (λ _ #'expr)
     17                            (range (syntax-e #'n))))]))
     18 
     19 (repeat-stx 1 (check-not-exn (λ () (structure [test-fa 2 : Number]
     20                                               [test-fb "b" : String]))))
     21 
     22 ;(repeat-stx 1024 (check-not-exn (λ () (structure [test-fa 2 : Number]
     23 ;                                                 [test-fb "b" : String]))))