... | ... | @@ -11,4 +11,22 @@ Function `read` (original Hope uses it to read files) in Hopeless has an ability |
|
|
|
|
|
## Writing script with parameters
|
|
|
|
|
|
Hopeless may be used as a scripting language. The only difference from original Hope implementation is an ability to omit quotations when `write` command should print list of strings (string is list of chars): |
|
|
\ No newline at end of file |
|
|
Hopeless may be used as a scripting language. The only difference from original Hope implementation is an ability to omit quotations when `write` command should print list of strings (string is a list of chars). Constant list of strings `argv` may be used for arguments. Lets create program *test1.hop*:
|
|
|
|
|
|
#!/usr/local/bin/hopeless -f
|
|
|
write argv;
|
|
|
|
|
|
Then we try to launch it:
|
|
|
|
|
|
./test1.hop
|
|
|
./test1.hop a
|
|
|
a
|
|
|
./test1.hop a b
|
|
|
a
|
|
|
b
|
|
|
./test1.hop a b c
|
|
|
a
|
|
|
b
|
|
|
c
|
|
|
|
|
|
As you can see predefined list `argv` consists of command lines arguments (but not program name itself). |
|
|
\ No newline at end of file |