Re: [racket-users] dynamic-require

2021-02-03 Thread jon stenerson
Very good! Thank you. On 2/2/2021 8:31 PM, jon stenerson wrote: The previous message here prompts this ... I have some modules with paths "A1.rkt" ... "An.rkt". In the interaction window of DrRacket I can require any or all of them and I believe them to be correct. Now suppose I have a fun

Re: [racket-users] dynamic-require

2021-02-03 Thread Laurent
You may be looking for `module->exports`: https://docs.racket-lang.org/reference/Module_Names_and_Loading.html?q=module-%3Eexports#%28def._%28%28quote._~23~25kernel%29._module-~3eexports%29%29 On Wed, Feb 3, 2021 at 3:31 AM jon stenerson wrote: > The previous message here prompts this ... > > I

[racket-users] dynamic-require

2021-02-02 Thread jon stenerson
The previous message here prompts this ... I have some modules with paths "A1.rkt" ... "An.rkt". In the interaction window of DrRacket I can require any or all of them and I believe them to be correct. Now suppose I have a function (F) that produces one of those paths. I try  (dynamic-requir

Re: [racket-users] (dynamic-require) performance problem

2018-02-12 Thread Dmitry Pavlov
Matthew, I can imagine a problem where the "language implementation" is in the reader, in which case it wouldn't get run when loading from bytecode, but that doesn't explain why `racket ` works --- unless the initialization is also triggered by a `main` or `configure-runtime` submodule, which wo

Re: [racket-users] (dynamic-require) performance problem

2018-02-12 Thread Dmitry Pavlov
Does the port `p` contain the source text for , or does it contain the bytecode from the ".zo" file created by `raco make ? In this dedicated test, just the source text of and nothing else. I think this is the main cause of the performance difference, but just to make sure, does raco

Re: [racket-users] (dynamic-require) performance problem

2018-02-12 Thread Matthew Flatt
At Mon, 12 Feb 2018 16:38:32 +0300, Dmitry Pavlov wrote: > > I'm not clear on why you're using `require-input-port` here instead of > > `dyanmic-require` with 's path. > > Originally, I needed it to prepend "#lang " to the source because I > did not have it in the file. > That requirement is not s

Re: [racket-users] (dynamic-require) performance problem

2018-02-12 Thread Dmitry Pavlov
Matthew, I'm not clear on why you're using `require-input-port` here instead of `dyanmic-require` with 's path. Originally, I needed it to prepend "#lang " to the source because I did not have it in the file. That requirement is not so strict now and I will be able to lift it if it is critica

Re: [racket-users] (dynamic-require) performance problem

2018-02-12 Thread Matthew Flatt
At Mon, 12 Feb 2018 15:55:44 +0300, Dmitry Pavlov wrote: > I measure the time taken to execute a program in two different ways: > > 1. raco make ; time racket > > 2. raco make my-runner.rkt; raco make ; time racket my-runner.rkt > > > [...] > > To load it dynamically in my-runner.rkt, I use t

[racket-users] (dynamic-require) performance problem

2018-02-12 Thread Dmitry Pavlov
Hello, I have a performance problem with loading a Racket program dynamically. I measure the time taken to execute a program in two different ways: 1. raco make ; time racket 2. raco make my-runner.rkt; raco make ; time racket my-runner.rkt In the first case, execution takes ~1 second, in

Re: [racket-users] Dynamic-require a compile-time identifier?

2017-01-21 Thread Alex Knauth
> On Jan 21, 2017, at 6:27 PM, Dupéron Georges > wrote: > > I was going to suggest `dynamic-require-for-syntax`, but it seems to do > exactly the same thing as `dynamic-require`, i.e. give the value of a phase-0 > provided identifier. Is this normal? > > The `eval` trick is a good idea, I wo

[racket-users] Dynamic-require a compile-time identifier?

2017-01-18 Thread Alex Knauth
Is there a way to dynamic-require an identifier provided at phase 1? #file x.rkt #lang racket (provide (for-syntax x)) ; x is provided at phase 1 (define-for-syntax x 3) #file use.rkt #lang racket (dynamic-require-from-phase-1 "x.rkt" 'x) ;=> 3 I could do it by defining another module that did t

Re: [racket-users] dynamic-require of a string

2016-11-18 Thread Dan Liebgold
On Friday, November 18, 2016 at 4:46:38 PM UTC-8, Sam Tobin-Hochstadt wrote: > You'll need to use `eval` to evaluate the module. > Interesting... If I want to add more context (for errors and such), is there a good way to use read-syntax and eval-syntax? -- You received this message because y

Re: [racket-users] dynamic-require of a string

2016-11-18 Thread Sam Tobin-Hochstadt
You'll need to use `eval` to evaluate the module. Something like this: http://pasterack.org/pastes/17703 Sam On Fri, Nov 18, 2016 at 7:38 PM, Dan Liebgold wrote: > I have an odd use case, but is there any way to supply a string of the > contents of a module to something like require or dynamic

[racket-users] dynamic-require of a string

2016-11-18 Thread Dan Liebgold
I have an odd use case, but is there any way to supply a string of the contents of a module to something like require or dynamic-require? An example of my desired usage: http://pasterack.org/pastes/38798 Thanks, Dan -- You received this message because you are subscribed to the Google Groups

Re: [racket-users] dynamic-require

2016-03-20 Thread Scott Moore
If the definitions are saved as “test.rkt”, the following works:  #lang racket  (module a racket/base (displayln "hello"))  (dynamic-require '(submod "test.rkt" a) #f)  On March 16, 2016 at 12:13:46 PM, Jos Koot (jos.k...@gmail.com) wrote: Hi,   The following example of dynamic-require in the r

[racket-users] dynamic-require

2016-03-19 Thread Jos Koot
Hi, The following example of dynamic-require in the reference manual works in the interactions window of DrRacket, but not in its definitions window: (module a racket/base (displayln "hello")) (dynamic-require ''a #f) How do I do this in the definitions window? The reason I use dynamic-req

RE: [racket-users] dynamic-require

2016-03-19 Thread Jos Koot
: Jos Koot Subject: Re: [racket-users] dynamic-require If the definitions are saved as “test.rkt”, the following works: #lang racket (module a racket/base (displayln "hello")) (dynamic-require '(submod "test.rkt" a) #f) I also tried (dynamic-require ‘(submod “.” a) #

RE: [racket-users] dynamic-require

2016-03-18 Thread Jos Koot
Ir works fine. I must have overlooked something in the docs. Thanks again. Jos _ From: Scott Moore [mailto:sc...@thinkmoore.net] On Behalf Of Scott Moore Sent: miércoles, 16 de marzo de 2016 18:05 To: Jos Koot; Racket Users Cc: Jos Koot Subject: Re: [racket-users] dynamic-require If