#!/usr/bin/perl -w

my @required_modules = 
  ('+objsys', '+repl', '+editinp', '+tables', '+threads',
   '+syscalls', '+unixm', '+threadsx');

my @rs_args = map {
  ('-e', "(set! rst-args (cons \"$_\" rst-args))");
} @ARGV;

@rs_args = ('/usr/bin/rs',
            @required_modules,
            '/usr/lib/rscheme/lib/threaded-repl.scm',
            '-e', '(define rst-args \'())',
            @rs_args,
            '-e', '(startup-threads (reverse rst-args))');

system @rs_args;
