Benefits/implications of define-runtime-path

38 views
Skip to first unread message

Kathi Fisler

unread,
Jun 15, 2017, 9:57:20 AM6/15/17
to Racket Developers
The scribble infrastructure (libraries and build scripts) for Bootstrap use define-runtime-path in certain places, and I'm trying to understand the implications of modifying those uses to build-path instead. (This is in code which Danny Yoo originally wrote and I'm now trying to maintain).

Here are two specific examples:

   (define-runtime-path lessons-dir
     (build-path 'up "lessons"))

   (define (get-units-dir)
      (build-path courses-base (current-course) "units" "langs" "english"))

We are tempted to edit the lessons-dir definition to follow the form of get-units-dir (because we need to start using get-env to build these paths).  What would we lose if we did this?  We don't need to create executables.  We simply need to run scribble on a slew of files (and create a directory of html to deploy on our web-server).  We do depend on traverse-blocks in producing our html.  Does define-runtime-path do anything special for us in this case?

thanks,
Kathi

Jay McCarthy

unread,
Jun 15, 2017, 10:04:09 AM6/15/17
to Kathi Fisler, Racket Developers
define-runtime-path mainly does two things.

The first, which you allude to, is that it exposes to the compiler
than you need this path and so it should include the file if you were
to create an executable and arrange things so that accessing it via
the runtime path gives you the embedded file. I don't think you need
this feature.

The second, is that you can embed paths relative to the source file
into the code rather than having paths be relative to the current
working directory when you run it. So, if I run your original program
from /home/jay but it lives in /home/jay/class/cs99/code then
lessons-dir is /home/jay/class/cs99/lessons and not /home/lessons.

Jay
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-dev+...@googlegroups.com.
> To post to this group, send email to racke...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-dev/7f9ffb92-0662-4df8-ab04-8535d93a5e25%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
-=[ Jay McCarthy http://jeapostrophe.github.io ]=-
-=[ Associate Professor PLT @ CS @ UMass Lowell ]=-
-=[ Moses 1:33: And worlds without number have I created; ]=-
Reply all
Reply to author
Forward
0 new messages