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 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 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-require is that I want to set some parameters
before submod a is executed.
 
I found out I can do the following:
 
#lang racket
(module a racket/base (displayln "hello"))
(module b racket/base (current-output-port (open-output-file ...)))
(require 'b)
(require 'a)
 
To me this seems an ugly trick.
In addition I am not sure this is guaranteed to work consistently.
How can I dynamically require a submod in the same source as it is defined?
 
Jos
--
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.
For more options, visit https://groups.google.com/d/optout
<https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_op
tout&d=CwMBaQ&c=WO-RGvefibhHBZq3fL85hQ&r=OPR-Xys5wfSBIeTkWaH0D_htBR-X7qY24pT
HU6ib2iM&m=VqHxdZAuO-U_qOyna7fD3GK2MQyfkgIwtug93FpPF88&s=ZT-K4wiTqTz-ShMrQ2H
Ihuz6fL5ZDat1whDeAGe5UEA&e=> .


-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to