(blush)
No you are not misunderstanding my question. I was wrong about
define-values and confused by an error message related to
normalize-definition not being known in another
part of the program due to phase problems. Thank you so much for taking the
time to help me out!
Dan
On Sunday, April
Ok, three parts:
1. Is it possible to make `average` on `Byte` provably produce a
`Byte`? This is not going to be possible with plain Typed Racket, even
with refinements to the numeric tower. The problem is that maintaining
the invariant that a <= (* n 255) is not something that we can express
jus
Playing with this program. Its output is in the comments.
; /tmp/gen.rkt:9:10: assertion violation
; expected: a procedure
; given: #f
; in: method m
; (I/c (m (-> I? 1)))
; [...removed the rest of the error...]
; 1
(module gen-contracts racket/base
(require racket/contract racket/exn racket/gene
I’m confused by your assertion that define-values can’t be used recursively.
Here’s a program that does this:
#lang racket
(define-values (fact)
(λ (x) (if (= x 0) 1 (* x (fact (sub1 x))
(fact 14)
Am I misunderstanding your message?
John Clements
> On Apr 17, 2021, at 05:02, Dan Synek
I am trying to implement a variation of define. In order to do that I am
trying to understand the source of the define macro in racket.
It calls a function normalize-definition which looks like this:
(define-values (normalize-definition)
(case-lambda
[(stx lambda-stx check-context? al
5 matches
Mail list logo