[racket] executable starting in submodule

From: Bert De Ketelaere (bedeke at hotmail.com)
Date: Thu May 1 02:52:15 EDT 2014

Hello,

thank you very much.  I read that line, but I couldn't figure out what the "symbol-appending the write form of a submodule path ..." would look like.  I tried xsub and x-sub and searching the documentation, but couldn't find it.

Thanks again,

Bert

> From: mflatt at cs.utah.edu
> To: bedeke at hotmail.com
> CC: users at racket-lang.org
> Subject: Re: [racket] executable starting in submodule
> Date: Wed, 30 Apr 2014 16:48:14 -0600
> 
> Sorry for the long delay! I hope this answer is still useful.
> 
> Buried in the very long documentation for `create-embedding-executable`
> is the note
> 
>  When submodules are available and included, the submodule is given a
>  name by symbol-appending the write form of submodule path to the
>  enclosing module's name.
> 
> For example, if "x.rkt" contains
> 
>  #lang racket/base
>  'not-sub
>  (module sub racket/base
>    'sub)
> 
> then the name you want is '|x(sub)|:
> 
>  (create-embedding-executable
>   "x"
>   #:gracket? #f
>   #:verbose? #f
>   #:modules '((#f "x.rkt" (sub)))
>   #:configure-via-first-module? #t
>   #:literal-expression
>   (parameterize ([current-namespace (make-base-namespace)])
>     (compile `(namespace-require ''|x(sub)|))))
> 
> 
> At Mon, 14 Apr 2014 17:06:15 +0200, Bert De Ketelaere wrote:
> > Hello,
> > 
> > is it possible to let an embedded-executable start in a submodule?
> > If yes, how do you do this?
> > 
> > I tried
> >       (create-embedding-executable
> >          exe-name
> >          #:gracket? #f
> >          #:verbose? #f
> >          #:modules (if (build-subs B)
> >                                  `((#f ,filename ,(submods))
> >                                  `((#f ,filename)))
> >          #:configure-via-first-module? #t
> >          #:literal-expression
> >          (parameterize ([current-namespace (make-base-empty-namespace)])
> >            (namespace-require 'racket/base)
> >            (if (build-subs B)
> >                (compile `(namespace-require '(submod ',(string->symbol 
> > (path->string short-program-name))
> >                                                     
> >                                     ,(string->symbol (build-subs B)))))
> >                (compile `(namespace-require '',(string->symbol (path->string 
> > short-program-name)))))))
> > 
> > but I get:
> >     require: unknown module
> >           module name: #<resolved-module-path:(submod 'filename submods)>
> >           context...:
> >            loop
> > 
> > Also, does the resolved-module-path structure mean that the path was completely 
> > resolved during compilation, or only the first step?
> > Any help would be appreciated,
> > 
> > Bert
> >  		 	   		  ____________________
> >   Racket Users list:
> >   http://lists.racket-lang.org/users
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140501/a0dd24f9/attachment.html>

Posted on the users mailing list.