GOSH(1)

πŸ“¦
version 0.9.15-p2+20241205 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

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 the gosh version and dips. πŸ‘‹
  • -b β€” Batch mode. Doesn't print a prompt even when standard input is a terminal. Supersedes -i. πŸ’ͺ
  • -h β€” Print the help message to stdout and exit with 0. 🫢
  • -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 the main procedure is defined. The default is user. (Main character energy, obviously.)
  • -ptype β€” Turns on the profiler. type can be either 'time' or 'load'. πŸ”₯
  • -rstandard β€” Starts gosh with the default environment defined in RnRS, where n is determined by standard. Currently, only 7 is 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's gosh instead. Super useful when you want to invoke a specific version of Gauche. The version must be 0.9.6 or later. ⭐
  • -fflag β€” Sets various flags. 🌈
    • case-fold β€” use case-insensitive reader (as in R5RS)
    • load-verbose β€” report while loading files
    • include-verbose β€” report while including files
    • no-inline β€” don't inline primitive procedures and constants (combined no-inline-globals, no-inline-locals, no-inline-constants and no-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 in cond-expand forms.
  • -- β€” 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 πŸ¦„


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