Am Mo., 20. Apr. 2020 um 17:35 Uhr schrieb Lassi Kortela <
xxxxxx@lassi.io>:
> I can't find any mention of scripts in R7RS-small. Is it in -large only?
>
> Indeed, R7RS talks about programs and the REPL, but not about scripts.
> R6RS talks about scripts, as does SRFI 22. SRFI 138 talks about programs.
>
> In fact, it is not easy to write portable "scripts" with the REPL as
> specified by R7RS-small. Consider the following REPL "script":
Agreed. I thought there is an unspoken understanding that code is loaded
into the REPL environment on an "I know what I'm doing" basis - i.e.
everyone has the right to break their own REPL if they want to :)
> In fact, there is no reason to because the R7RS top-level
> program semantics suffice completely to write scripts.
Also agreed. Or at least I can't think of any problem with using program
semantics for scripts, and haven't had any problems using them for the
countless scripts I've written.
Nevertheless, 193 should address the cases of:
* `fantastic-scheme <foo.scm` from the shell
This could run "foo.scm" as a program (in the sense of R7RS).
* `(load "foo.scm")` from the REPL
It may be best if these are neither a "command" nor a "script" according
to 193's current terminology.
However, since "load" is given the script filename, it would be useful
to treat it as a "script" so that (script-directory) can be used to load
auxiliary files from the directory where foo.scm lives.