File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed
hackett-lib/hackett/private
tests/hackett/integration Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 392392 #:with id- (generate-temporary #'id )
393393 #:with t_reduced (if (attribute exact?) #'t.expansion (type-reduce-context #'t.expansion ))
394394 #`(begin-
395- (define- id- (:/use #,((attribute t.scoped-binding-introducer) #'e ) t_reduced #:exact ))
396395 #,(indirect-infix-definition
397396 #'(define-syntax- id (make-typed-var-transformer #'id- (quote-syntax t_reduced)))
398- (attribute fixity.fixity)))]
397+ (attribute fixity.fixity))
398+ (define- id- (:/use #,((attribute t.scoped-binding-introducer) #'e ) t_reduced #:exact )))]
399399 [(_ id:id
400400 {~optional fixity:fixity-annotation}
401401 e:expr)
404404 #:do [(match-define-values [(list id-) e-] (τ⇐/λ! #'e #'t_e (list (cons #'id #'t_e ))))]
405405 #:with t_gen (type-reduce-context (generalize (apply-current-subst #'t_e )))
406406 #`(begin-
407- (define- #,id- #,e-)
408407 #,(indirect-infix-definition
409- #`(define-syntax- id
410- (make-typed-var-transformer ( quote-syntax #,id-) ( quote-syntax t_gen) ))
411- (attribute fixity.fixity) ))])
408+ #`(define-syntax- id (make-typed-var-transformer ( quote-syntax #,id-) ( quote-syntax t_gen)))
409+ (attribute fixity.fixity ))
410+ (define- #,id- #,e- ))])
412411
413412(begin-for-syntax
414413 (struct todo-item (full summary) #:prefab ))
Original file line number Diff line number Diff line change 55(define deps
66 '("base "
77 "hackett-lib "
8+ "rackunit-lib "
9+ "sandbox-lib "
810 "testing-util-lib " ))
911(define build-deps
1012 '() )
Original file line number Diff line number Diff line change 1+ #lang racket/base
2+
3+ ; Ensure recursive definitions work at the top level.
4+
5+ (require racket/sandbox
6+ rackunit
7+ syntax/strip-context)
8+
9+ (define hackett-evaluator (make-evaluator 'hackett ))
10+ (define (hackett-eval stx) (hackett-evaluator (strip-context stx)))
11+
12+ (hackett-eval #'(require hackett))
13+ (hackett-eval #'(defn fac : {Integer -> Integer}
14+ [[0 ] 1 ]
15+ [[x] {x * (fac {x - 1 })}]))
16+
17+ (check-equal? (hackett-eval #'(fac 6 )) (hackett-eval #'720 ))
You can’t perform that action at this time.
0 commit comments