Le dimanche 7 mai 2017 00:27:36 UTC+2, Daniel Prager a écrit :
> Thanks Georges
> It looks suggestive, but I'm struggling to follow the details of
> with-contract / blame-id. An example of use would be very helpful in the docs!
This gives "blaming: (region unsafe-factorial)" instead of "blaming: (function
unsafe-factorial)". Aside from this slight leak, the messages are identical.
Supposing this code is correct (I never used with-contract before), if you
clean it up a bit and add an example to the docs, I'm sure a PR would be
welcome :) .
(define-syntax-rule (define/tight (fn args ...)
(define (fn args ...) (fn/impl args ...))
#:freevar fn ctc
(define (fn/impl args ...)
(define/tight [unsafe-factorial n]
(-> (and/c integer? (>=/c 0)) (and/c integer? (>=/c 0)))
(if (zero? n)
(* n (unsafe-factorial (- n 10)))))
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
For more options, visit https://groups.google.com/d/optout.