leif
2019-12-24 18:53:50

@mflatt & @robby If I run this program in DrRacket and the command line:

#lang racket (variable-reference->module-path-index (#%variable-reference))


leif
2019-12-24 18:54:05

In the command line I get a relative path:

#<module-path-index:(file "samples/wat.rkt")>


leif
2019-12-24 18:54:26

But in DrRacket I get an absolute one:

#<module-path-index:#<path:/home/leif/papers/interactive-syntax/samples/wat.rkt>>


leif
2019-12-24 18:54:44

Do either of you know why you get a difference?


leif
2019-12-24 18:55:37

Its…err…well…giving me inconsistent behavior when building a paper in DrRacket vs in the command line.


mflatt
2019-12-24 19:08:59

The racket executable reflects how you referenced the module in the first place. So, I think you ran with racket samples/wat.rkt as opposed to racket /home/leif/papers/interactive-syntax/samples/wat.rkt. DrRacket always references (effectively) the module as an absolute path.


leif
2019-12-24 19:14:44

@mflatt Interesting. Although when I run it from the command line with an absolute path, it still comes up differently than drracket.


leif
2019-12-24 19:15:23

$ racket /home/leif/papers/interactive-syntax/samples/wat.rkt #<module-path-index:(file "/home/leif/papers/interactive-syntax/samples/wat.rkt


leif
2019-12-24 19:16:01

Woops, missed the last bit of line: $ racket /home/leif/papers/interactive-syntax/samples/wat.rkt #<module-path-index:(file "/home/leif/papers/interactive-syntax/samples/wat.rkt")>


leif
2019-12-24 19:16:17

Anyway, the difference between in DrRacket its a path, in the command line, its a string.


leif
2019-12-24 19:22:55

Ah, okay. I think I get it. So if I do something like: $ racket > (define mp (path->complete-path "wat.rkt")) > (dynamic-require mp #f) #<module-path-index:#<path:/home/leif/papers/interactive-syntax/samples/wat.rkt>> Which looks a lot like DrRacket’s output. So I suspect its doing something like that. Thanks.


soegaard2
2019-12-24 21:18:35

Racket Stories now has more than a 100 links! https://racket-stories.com/


spdegabrielle
2019-12-24 21:23:54

That’s a nice Christmas present ! Thank you @soegaard2 for building Racket Stories