I have a few files that start like this:
#lang racket/base
(require "my-library.rkt")
I would be very happy if I could start my files with:
#lang my-library
Is it possible to use a library as a #lang? What changes would I need to make to my-library.rkt?
If your library isn't going to do anything "lang like", and you merely want to eliminate the require? You could:
Change my-library.rkt as Chris describes: Add (provide (all-from-out racket/base)). But don't bother creating any my-library/lang/reader.rkt file.
To use it: #lang s-exp "my-library.rkt". Note the s-exp, so technically this doesn't answer your question exactly. :)
Keep in mind that you can shadow bindings in my-library.rkt now that it's being used as a lang instead of being required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With