Re: [racket-users] [racket] error : Attempted to use a higher-order value passed as `Any` in untyped code:

2018-04-16 Thread mailoo
Hello, 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. Thank you! Denis On 04/16/2018 04:01 PM, Matthias Felleisen wrote: Have you considered

Re: [racket-users] I like HtDP, what's next? I guess I can't wait for HtDComponents / HtDSystems ... is there anything out now?

2018-04-16 Thread Matthias Felleisen
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

[racket-users] 2nd call for papers: Trends in Functional Programming, 11-13 june 2018, Chalmers Campus Johanneberg, Gothenburg

2018-04-16 Thread p.achten
- 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

Re: [racket-users] [racket] error : Attempted to use a higher-order value passed as `Any` in untyped code:

2018-04-16 Thread Greg Hendershott
Maybe do you want `require/typed`? See: https://docs.racket-lang.org/ts-guide/typed-untyped-interaction.html#%28part._.Using_.Untyped_.Code_from_.Typed_.Code%29 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group

Re: [racket-users] [racket] error : Attempted to use a higher-order value passed as `Any` in untyped code:

2018-04-16 Thread Matthias Felleisen
Have you considered organizing your program as follows: #lang racket (module a racket (provide f) (define (f x) 10)) (module b racket (provide g) (define g (dynamic-require '(submod "foo.rkt" a) 'f))) (module c typed/racket (require/typed (submod ".." b) [g (-> Integer Integer)])

Re: [racket-users] Using serial-lambda to send lambdas to places

2018-04-16 Thread Zelphir Kaltstahl
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

[racket-users] How to access lexical context from macro?

2018-04-16 Thread Dmitry Pavlov
Hello, I would like to write two seemingly simple macros and I found no way to do it. (my-let ((x 2)) (begin (begin (begin (access x) (access y) I would like the (access) macro to know at compile (expansion) time that x is up there in (my-let) macro and y is

Re: [racket-users] How to access lexical context from macro?

2018-04-16 Thread 'Dionna Amalie Glaze' via Racket Users
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

Re: [racket-users] How to access lexical context from macro?

2018-04-16 Thread Dmitry Pavlov
Amalie, 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

Re: [racket-users] How to access lexical context from macro?

2018-04-16 Thread 'Dionna Amalie Glaze' via Racket Users
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. For example,

Re: [racket-users] How to access lexical context from macro?

2018-04-16 Thread Dmitry Pavlov
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. Like

Re: [racket-users] How to access lexical context from macro?

2018-04-16 Thread Dmitry Pavlov
Oh, syntax-parameter-value has helped. #lang racket (require (for-syntax syntax/parse syntax/transformer) racket/stxparam) (define-syntax-parameter my-info '()) (define-syntax (access stx)   (syntax-parse stx     ((_) (printf "my-info = ~v\n" (syntax-parameter-value #'my-info))  

[racket-users] [racket] error : Attempted to use a higher-order value passed as `Any` in untyped code:

2018-04-16 Thread mailoo
Hello, 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))