Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing Racket Beginning Student scripts in terminal without wrapping in a module

Tags:

I try to execute a script written in one of the Teaching Languages (e.g. Beginning Student) delivered with DrRacket environment.

I can achieve that by wrapping the code into a module (just like DrRacket does):

#reader(lib "htdp-beginner-reader.ss" "lang")((modname my_module) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
;; my code goes here

However, it would be much more preferred for me not to wrap my code into a module. Is it possible to achieve that by passing command line arguments (or in any other way)?

like image 474
Robson Avatar asked May 05 '17 08:05

Robson


1 Answers

You can use something like #lang htdp/bsl. The list I see available is asl, bsl, bsl+, isl, and isl+. If you know the language it's supposed to be in you can use these, perhaps a short script to prepend this to a temp file before launching (I assume you're using command line racket and not DrRacket, since in DrRacket you can just choose the language in the bottom left to be the right language).

I was not able to find a way to configure the racket executable to impose a language at the start. Hopefully someone else comes along to explain how -I is supposed to set the language because I couldn't figure it out.

like image 198
law-of-fives Avatar answered Sep 23 '22 10:09

law-of-fives