mirror of
https://github.com/hymkor/lispect.git
synced 2026-09-05 16:47:42 -04:00
Improve the header comments of RunFile and RunScript
This commit is contained in:
@@ -8,11 +8,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// RunFile loads and executes a Lisp script from the specified file.
|
// RunFile loads and executes a Lisp script from the specified file.
|
||||||
//
|
// - `fname`: the path to the Lisp source file to be executed.
|
||||||
// - fname: the path to the Lisp source file to be executed.
|
// - `args`: a slice of arguments typically corresponding to os.Args[1:].
|
||||||
// - args: typically corresponds to os.Args[1:].
|
// - `args[0]` is set to the Lisp variable `*program-name*`.
|
||||||
// - args[0]: the script file name (not used directly).
|
// - `args[1:]` is set to the Lisp variable `*argv*`.
|
||||||
// - args[1:]: arguments passed to the script.
|
|
||||||
func RunFile(fname string, args []string) error {
|
func RunFile(fname string, args []string) error {
|
||||||
script, err := os.ReadFile(fname)
|
script, err := os.ReadFile(fname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -57,11 +56,10 @@ func New() (*Env, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RunString executes a Lisp script given directly as a string.
|
// 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).
|
||||||
// - 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: typically corresponds to os.Args[1:].
|
// - `args[0]` is set to the Lisp variable `*program-name*`.
|
||||||
// - args[0]: the script file name (not used directly).
|
// - `args[1:]` is set to the Lisp variable `*argv*`.
|
||||||
// - args[1:]: arguments passed to the script.
|
|
||||||
func RunString(script string, args []string) error {
|
func RunString(script string, args []string) error {
|
||||||
env, err := New()
|
env, err := New()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user