First thank Greg and Mathias for looking at my problem.
And yes, the proposed solution is working! I didn't think at all by
putting a "module in the middle", to by-pass my cast operation.
On 04/16/2018 04:01 PM, Matthias Felleisen wrote:
Have you considered
In the spirit of general advice, the best “programmers” (I have come to prefer
sw devs) are highly reflective people. And as Neil says, don’t trust yourself
too much when you reflect on your work.
> On Apr 15, 2018, at 4:14 PM, Neil Van Dyke wrote:
> Five fuzzy
2 N D C A L L F O R P A P E R S
TFP 2018 ===
19th Symposium on Trends in Functional Programming
Maybe do you want `require/typed`?
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group
Have you considered organizing your program as follows:
(module a racket
(define (f x) 10))
(module b racket
(define g (dynamic-require '(submod "foo.rkt" a) 'f)))
(module c typed/racket
(require/typed (submod ".." b) [g (-> Integer Integer)])
Thanks for the example code.
I will look at it soon, when I can code on that code again and see where
I can get. Seems I misunderstood and thought you were suggesting to use
the non-ergonomic way of identifying procedures for serial-lambda.
That's probably, because I do not understand the source
I would like to write two seemingly simple macros and I found
no way to do it.
(my-let ((x 2))
I would like the (access) macro to know at compile (expansion)
time that x is up there in (my-let) macro and y is
syntax-local-value is likely what you'll want to use here. You can bind
your x to a compile-time value that you can access with syntax-local-value.
You can even make that value a struct with #:procedure prop:procedure and
have its procedure be a syntax transformer (so it can expand into something
Thank you, this is impressive and helpful. I did not know about
syntax-local-value (I also am not certain that I know it now good enough).
However, I did not mean to use the (my-let)'s "definition" of x to pass
information to (access). (Also, can (access y) fail in a customizable
You can "pass" information from one macro to another by binding information
to an identifier defined to be a syntax parameter that both macros have in
scope. You would need to functionally update its value for each rebinding. Its
value would be retrievable with syntax-local-value.
You can "pass" information from one macro to another by binding
information to an identifier defined to be a syntax parameter that
both macros have in scope. You would need to functionally update its
value for each rebinding. Its value would be retrievable with
Oh, syntax-parameter-value has helped.
(require (for-syntax syntax/parse syntax/transformer)
(define-syntax-parameter my-info '())
(define-syntax (access stx)
(printf "my-info = ~v\n" (syntax-parameter-value #'my-info))
I'm new to racket, and even more with typed/racket.
I play a little with the "Any" type (due to 'dynamic-require' which
return Any), and I'm not able to cast them back in a function.
I (over) simplify my question with this little program :
(: p Any)
(define (p i) (displayln i))
Mail list logo