From f8740f317c5698ad47825b73c7690a86b789987c Mon Sep 17 00:00:00 2001 From: HAYAMA_Kaoru Date: Sun, 4 May 2025 17:26:23 +0900 Subject: [PATCH] Improve the header comments of RunFile and RunScript --- main.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index 61975e8..8df9627 100644 --- a/main.go +++ b/main.go @@ -8,11 +8,10 @@ import ( ) // RunFile loads and executes a Lisp script from the specified file. -// -// - fname: the path to the Lisp source file to be executed. -// - args: typically corresponds to os.Args[1:]. -// - args[0]: the script file name (not used directly). -// - args[1:]: arguments passed to the script. +// - `fname`: the path to the Lisp source file to be executed. +// - `args`: a slice of arguments typically corresponding to os.Args[1:]. +// - `args[0]` is set to the Lisp variable `*program-name*`. +// - `args[1:]` is set to the Lisp variable `*argv*`. func RunFile(fname string, args []string) error { script, err := os.ReadFile(fname) if err != nil { @@ -57,11 +56,10 @@ func New() (*Env, error) { } // RunString executes a Lisp script given directly as a string. -// -// - script: the Lisp source code to be executed (equivalent to the contents of a file). -// - args: typically corresponds to os.Args[1:]. -// - args[0]: the script file name (not used directly). -// - args[1:]: arguments passed to the script. +// - `script`: the Lisp source code to be executed (equivalent to the contents of a file). +// - `args`: a slice of arguments typically corresponding to os.Args[1:]. +// - `args[0]` is set to the Lisp variable `*program-name*`. +// - `args[1:]` is set to the Lisp variable `*argv*`. func RunString(script string, args []string) error { env, err := New() if err != nil {