Discussion:
[racket] Using define-runtime-path from *SL
Nadeem Abdul Hamid
2015-03-18 13:46:55 UTC
Permalink
How can I use define-runtime-path from *SL? I have a little teachpack that
exports the play-sound/play-background-sound functions so students can use
that in a game, but when you create an executable the sound files are not
packaged up. I figured that define-runtime-path needs to be used for that,
but exporting that from the teachpack gives an error when you try to use it
from a *SL program.

--- nadeem
Matthias Felleisen
2015-03-18 14:47:07 UTC
Permalink
Welcome to DrRacket, version 6.1.1.8--2015-03-11(-/f) [3m].
Language: Intermediate Student with lambda.
(require racket/runtime-path)
(define-runtime-path y "hello world")
-- Matthias
How can I use define-runtime-path from *SL? I have a little teachpack that exports the play-sound/play-background-sound functions so students can use that in a game, but when you create an executable the sound files are not packaged up. I figured that define-runtime-path needs to be used for that, but exporting that from the teachpack gives an error when you try to use it from a *SL program.
--- nadeem
____________________
http://lists.racket-lang.org/users
____________________
Racket Users list:
http://lists.racket-lang.org/users
Nadeem Abdul Hamid
2015-03-19 03:05:37 UTC
Permalink
Yes, that does work, thanks.

I had put
(require racket/runtime-path)
(provide define-runtime-path)
into the teachpack file, but then in an ISL file, doing:
(require "the-lib.rkt")
(define-runtime-path y "hello world")
was giving:
?: literal data is not allowed;
no #%datum syntax transformer is bound in the transformer environment

Anyway, sorry about the noise.
Post by Matthias Felleisen
Welcome to DrRacket, version 6.1.1.8--2015-03-11(-/f) [3m].
Language: Intermediate Student with lambda.
(require racket/runtime-path)
(define-runtime-path y "hello world")
-- Matthias
How can I use define-runtime-path from *SL? I have a little teachpack
that exports the play-sound/play-background-sound functions so students can
use that in a game, but when you create an executable the sound files are
not packaged up. I figured that define-runtime-path needs to be used for
that, but exporting that from the teachpack gives an error when you try to
use it from a *SL program.
--- nadeem
____________________
http://lists.racket-lang.org/users
Robby Findler
2015-03-19 03:17:04 UTC
Permalink
You probably need to do this:

(require (for-syntax racket/base))
(provide (for-syntax #%datum))

in the teachpack.

Robby
Post by Nadeem Abdul Hamid
Yes, that does work, thanks.
I had put
(require racket/runtime-path)
(provide define-runtime-path)
(require "the-lib.rkt")
(define-runtime-path y "hello world")
?: literal data is not allowed;
no #%datum syntax transformer is bound in the transformer environment
Anyway, sorry about the noise.
Post by Matthias Felleisen
Welcome to DrRacket, version 6.1.1.8--2015-03-11(-/f) [3m].
Language: Intermediate Student with lambda.
(require racket/runtime-path)
(define-runtime-path y "hello world")
-- Matthias
How can I use define-runtime-path from *SL? I have a little teachpack
that exports the play-sound/play-background-sound functions so students can
use that in a game, but when you create an executable the sound files are
not packaged up. I figured that define-runtime-path needs to be used for
that, but exporting that from the teachpack gives an error when you try to
use it from a *SL program.
--- nadeem
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
Racket Users list:
http://lists.racket-lang.org/users

Loading...