]> git.lizzy.rs Git - uwu-nolambda.git/blob - README.md
Create LICENSE
[uwu-nolambda.git] / README.md
1 # nolambda
2 nolambda is a collection of native [uwu](https://github.com/EliasFleckenstein03/uwulang) modules that break the lambda paradigm, such as linear execution, I/O, globals etc.
3
4 ## Modules
5
6 ### `nolambda:flow`
7
8 - `nolambda:flow:linear`: Accepts an arbitrary number of arguments of arbitrary type, but at least one and evaulates all of them in order. Returns the last argument.
9 - `nolambda:flow:error`: Accepts a string as $0, prints the string to stderr and exits the program with failure.
10
11 ### `nolambda:io`
12
13 - `nolambda:io:print`: Accepts a string as $0 and prints it to stdout, followed by a newline.
14 - `nolambda:io:scan`: Reads a line from stdin and returns it as a string, without the newline character at the end. This is interally using readline.
15
16 ### `nolambda:fs`
17
18 Note: all file paths are relative to the _directory the program was started from_.
19
20 - `nolambda:fs:read`: Accepts a file name (string) as $0 and returns it's contents as a string. Causes an error if the file does not exist.
21 - `nolambda:fs:write`: Accepts a file name (string) as $0 and overwrites it with the contents in $1 (string). Causes an error if the file could not be written.
22 - `nolambda:fs:remove`: Accepts a file name (string) as $0 and removes it from the file system. Causes an error if the file could not be removed, but does not cause an error if the file does not exist.
23 - `nolambda:fs:exists`: Accepts a file name (string) as $0 and returns `:bool:true` if it exists, `:bool:fase` else.
24
25 ### `nolambda:os`
26
27 - `nolambda:os:exit`: Optionally takes an exit code (integer) as $0 and exits the program with the given exit code, or 0 if no exit code was given.
28 - `nolambda:os:sleep`: Takes an integer as $0 and pauses the execution of the program for $1 milliseconds.
29 - `nolambda:os:execute`: Takes a command (string) as $0 and executes it as a shell command. Returns the exit code of the command as an integer.
30
31 ### `nolambda:global`
32
33 - `nolambda:global:set`: Creates or overwrites a global variable named $0 (string) and puts the contents of $1 (arbitrary type) into it.
34 - `nolambda:global:get`: Gets the global variable named $0 (string). Causes an error if the variable does not exist.
35 - `nolambda:global:exists`: Returns `:bool:true` if the global variable named $0 (string) exists, `:bool:false` else.
36 - `nolambda:global:delete`: Deletes the global variable named $0 (string). Does **not** cause an error if the variable does not exist.