Relative Pathname problem

53 views
Skip to first unread message

Amir Teymuri

unread,
Jun 20, 2019, 6:07:54 PM6/20/19
to Racket Users
I have the following situation:

mylibrary:
  •    src
    • font.rkt
    • gui.rkt
  • scratch.rkt

So the src/ directory and the scratch.rkt file live in the same directory mylibrary/. According to the documentation of Modules (https://docs.racket-lang.org/guide/module-basics.html):

The "sort.rkt" module uses the relative paths "db/lookup.rkt" and "machine/control.rkt" to import from the database and machine-control libraries...

So i put these lines in my scratch.rkt:

#lang racket

(require "src/font.rkt"
     "src/gui.rkt")

but upon requiring the modules i get the error:



(require "src/font.rkt"
     "src/gui.rkt")

Error: struct:exn:get-module-code

get-module-code: no such file: #<path:/path/to//mylibrary/src/src/font.rkt>

Why is Racket putting another src/ before the actual src/ directory?

Thanks,
Amir

Ben Greenman

unread,
Jun 22, 2019, 10:55:20 PM6/22/19
to Amir Teymuri, Racket Users
I tried to reproduce this problem, but wasn't able to.

Which version of Racket are you using? How did you run the program?

On 6/20/19, Amir Teymuri <ateym...@gmail.com> wrote:
> I have the following situation:
>
> mylibrary:
>
> - src
> - font.rkt
> - gui.rkt
> - scratch.rkt
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/ed560f1e-93df-4835-ad62-0d8b76cd8ed6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Amir Teymuri

unread,
Jun 23, 2019, 4:03:33 PM6/23/19
to Racket Users
I have version 7.3. The problem was that i have to start the interactive racket from the scratch.rkt file which imports from other modules. I am using racket on Emacs with the Geiser mode.

Sorawee Porncharoenwase

unread,
Jun 23, 2019, 4:17:12 PM6/23/19
to Amir Teymuri, Racket Users

This is almost certainly due to Geiser and not Racket. IIRC, there are C-c C-a and C-c C-b. One of them works with Racket and the other does not.

If you only work with Racket, I would recommend racket-mode instead of Geiser. It's far more integrated to Racket.


To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/3ffd20cb-2f00-4b98-8b48-054cf4a265b3%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages