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 <dansy...@gmail.com> wrote:
> 
> 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? allow-key+opt?)
>       (let-values ([(id mk-rhs body)
>                     (normalize-definition/mk-rhs stx lambda-stx 
> check-context? allow-key+opt? #t)])
>         (values id (mk-rhs body)))]
>      [(stx lambda-stx check-context?) (normalize-definition stx lambda-stx 
> check-context? #f)]
>      [(stx lambda-stx) (normalize-definition stx lambda-stx #t #f)])))
> 
> In the two last cases of the case-lambda there is a call to 
> normalize-definition. It is not a recursive call, since define-values cannot 
> be used recursively. I cannot find any other normalize-definition in the 
> modules required by the norm-define module.
>  If I try to enter a copy of the definition (renamed to 
> normalize-definition1) I get (as expected) that normalize-definition1 is 
> undefined.
> What is going on?
> Thanks
> Dan
> 
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/ce5ce36e-03ee-44b1-a5ae-4f5a6e7b9d1en%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/3e1d308f-ab29-47e5-b42e-fdff07739645%40mtasv.net.

Reply via email to