Thank-you Matthias That's neat!
And yes, I can write a basic macro. By introducing #:freevar I was able to improve the blame situation, but the abstraction is a bit leaky ... (define-syntax-rule (define/tight (fn args ...) ctc body ...) (begin (define (fn args ...) (fn/impl args ...)) (define/contract (fn/impl args ...) ctc #:freevar fn ctc ; Directs blame to "fn/impl" rather than the enclosing module body ...))) Dan On Sat, May 6, 2017 at 11:15 AM, Matthias Felleisen <matth...@ccs.neu.edu> wrote: > > Sure: > > #lang racket > > (define/contract [unsafe-factorial n] > (-> (and/c integer? (>=/c 0)) (and/c integer? (>=/c 0))) > (if (zero? n) > 1 > (* n (factorial (- n 10))))) > (define (factorial n) (unsafe-factorial n)) ;; cross the boundary and go > right back in > (unsafe-factorial 5) ; Does not terminate > > > I suspect you can implement this with a macro now. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.