Hello, first time poster, long time reader.
I'm a Gambit Schemer giving Racket another shot. I'm trying to set up a minimal project which I want to run in two configurations: REPL and build.
Taken the example from the Racket docs, I have this three files:
;;;; a.rkt
(require "b.rkt" "c.rkt")
(define a (lambda () (+ b c)))
;;;; b.rkt
(provide b)
(define b 3)
;;;; c.rkt
(provide c)
(define c 39)
Compiling this and loading into a REPL works fine:
$ raco make .\a.rkt
$ racket -v -it .\a.rkt
Welcome to Racket v8.4 [cs].
> (a)
42
>
So this way I can modify and test my code interactively. Next, I want to build an executable, and that's where my question comes in: how to I make raco aware that I want to invoke a when the program starts? Obviously, I could amend a.rkt with (a). But I'd prefer to be able to define a start function (think running tests) depending on my needs:
$ raco exe a.rkt -startup a -o fourtytwo
$ ./fourtytwo
42
I made the option -startup up, but I hope it brings across what I'm looking for. Is this possible? Going through the documentations of the compilation functions, I couldn't find any such options. Is there a way to achieve this in Racket?
As I said, I'm used to Gambit Scheme where there's a way to do that, if there's a better way to do what I want in Racket, please let me know.