GOSH(1)
gosh(1) from the Gauche Commands part of the manual β bestie, come get your Scheme π
π NAME π
gosh β a Scheme script interpreter β¨
π¦ SYNOPSIS π¦
gosh [-bhiqV] [-I path ] [-A path ] [-u module ] [-l file ] [-L file ]
[-e expr ] [-E expr ] [-m module ] [-f flag ] [-F feature ] [-p type ]
[-r standard ] [--] [ script argument ... ]
π DESCRIPTION π
So. Gosh is a stand-alone Scheme interpreter built on top of the Gauche Scheme script engine. That's the whole vibe. π«
When you hand it a script, gosh loads that script and evaluates the Scheme code chilling inside it. Then β plot twist β if the script defines a procedure named main, gosh calls it with a single argument: a list made of the script name plus whatever arguments came after it. When main returns an integer value, gosh exits with that as its exit code. But if main returns something non-integer, or an error gets signaled during evaluation, gosh bails out with exit code 70 (EX_SOFTWARE). π See SRFI-22 (http://srfi.schemers.org/srfi-22/srfi-22.html) for the deets. And if there's no main procedure defined in the script at all? gosh just exits with code 0 after loading the script file. Periodt. π
If no script file is given, gosh goes into interactive mode π§. By default it prompts you to enter a Scheme expression, reads and evaluates it, then prints the result β and keeps doing that until EOF is read. However, if standard input is not a terminal, gosh doesn't print a prompt at all, which lets you use gosh as a filter program π. You can control this behavior with the -i or -b option β see below π
β¨ OPTIONS β¨
Command line options are processed before loading the script file or entering the interactive mode. Order matters, bestie.
The options -I, -A, -u, -l, -L, -e and -E are processed in the order of appearance. For example, adding a load path with the -I option affects the -l options after it, but not the ones before it. It's giving chronological. β³
-Vβ Prints thegoshversion and dips. π-bβ Batch mode. Doesn't print a prompt even when standard input is a terminal. Supersedes-i. πͺ-hβ Print the help message tostdoutand exit with0. π«Ά-iβ Interactive mode. Forces it to print a prompt, even when standard input is not a terminal.-qβ Prevents reading the default initialization file. No starter pack for you. π-Ipathβ Adds path in front of the load path list. π-Apathβ Appends path to the tail of the load path list. π¦-umoduleβ Loads and imports module, exactly as if(use module )were specified in the code.-lfileβ Loads a Scheme file file. π-Lfileβ Like-l, but doesn't complain if file doesn't exist. So chill of her.-eexprβ Evaluates a Scheme expression expr.-Eexprβ Same as-e, except that expr is read as if it's surrounded by parenthesis. π-mmoduleβ When the script file is given, this option specifies the name of the module in which themainprocedure is defined. The default isuser. (Main character energy, obviously.)-ptypeβ Turns on the profiler. type can be either'time'or'load'. π₯-rstandardβ Startsgoshwith the default environment defined in RnRS, where n is determined by standard. Currently, only7is a valid value of standard. (Only 7. That's it. That's the list.)-vversionβ If version is not the running Gauche's version, but the specified version is installed in the system, execute that version'sgoshinstead. Super useful when you want to invoke a specific version of Gauche. The version must be0.9.6or later. β-fflagβ Sets various flags. πcase-foldβ use case-insensitive reader (as in R5RS)load-verboseβ report while loading filesinclude-verboseβ report while including filesno-inlineβ don't inline primitive procedures and constants (combinedno-inline-globals,no-inline-locals,no-inline-constantsandno-inline-setters.)no-inline-globalsβ don't inline global procedures.no-inline-localsβ don't inline local procedures.no-inline-constantsβ don't inline constants.no-inline-settersβ don't inline setters.no-post-inline-passβ don't run post-inline optimization pass.no-lambda-lifting-passβ don't run lambda lifting optimization pass.no-post-inline-passβ don't run post-inline optimization pass. (yes, she's on the list twice, that's literally what the page says, no I will not elaborate π)no-source-infoβ don't retain source information.read-editβ enable input editing mode, if terminal supports it.no-read-editβ disable input editing mode.safe-string-cursorsβ performs extra validation for use of string cursors.warn-legacy-syntaxβ print warning when legacy Gauche syntax is encountered.testβ assume being run in the build tree; tries to load files from the current build instead of installation directories. Useful to test the build without installation. π§ͺ
-Ffeatureβ Makes feature available incond-expandforms.--β Specifies that there are no more options. If there are more arguments after this, they're taken as the script file name and its arguments. π«‘
πΈ ENVIRONMENT πΈ
GAUCHE_LOAD_PATHβ A colon separated list of the load paths. The paths are appended before the system default load paths.GAUCHE_DYNLOAD_PATHβ A colon separated list of the load paths for dynamically loaded objects. The paths are appended before the system default load paths.
π AUTHORS π
Shiro Kawai (shiro @ acm . org) β icon, legend, the moment. π
π¦ SEE ALSO π¦
gauche-config(1)- Gauche Scheme script engine:
https://practical-scheme.net/gauche/ - For the information about Scheme language, see
https://www.schemers.org/
ok that's the whole page bestie, go forth and Scheme responsibly π«Ά
kisses, this was page GOSH(1) from Gauche 0.9.15-p2 β mwah πβ¨
π¦ where this page comes from
- debian trixie: gauche 0.9.15-p2+20241205-4
- ubuntu questing: gauche 0.9.15-p2+20241205-4
- ubuntu resolute: gauche 0.9.15-p2+20241205-4.1
- ubuntu stonking: gauche 0.9.15-p2+20241205-4.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms