doc wip
This commit is contained in:
parent
7ced8315da
commit
012f1d652b
83
doc/Doc.md
83
doc/Doc.md
|
|
@ -15,28 +15,61 @@
|
||||||
|
|
||||||
|
|
||||||
## Library
|
## Library
|
||||||
|
|Signature|Description|Return values|
|
||||||
#### Using the binary
|
|:-|-|-|
|
||||||
|
|`(= a b)`|Test whether two values are equal|`1` when equal otherwise `0`|
|
||||||
Run ml in interactive mode:
|
|`(!= a b)`|Test whether two values are not equal|`1` when not equal otherwise `0`|
|
||||||
|
|`(> a b)`|Test whether one value is greater to another |`1` when greater otherwise `0`|
|
||||||
```bash
|
|`(< a b)`|Test whether one value is less to another |`1` when less otherwise `0`|
|
||||||
$ ./ml
|
|`(>= a b)`|Test whether one value is greater or equal to another |`1` when greater or equal otherwise `0`|
|
||||||
>>> (print "Hello world!")
|
|`(<= a b)`|Test whether one value is less or equal to another |`1` when less or equal otherwise `0`|
|
||||||
Hello world!
|
|`(+ a b ..)`|Sum multiple values |sum of values|
|
||||||
=> "Hello world!"
|
|`(- a b)`|Substract two values |result of substraction|
|
||||||
```
|
|`(* a b ..)`|Multiply several values|result of multiplication|
|
||||||
|
|`(/ a b)`|Divide two values|result of division|
|
||||||
Interpret a file:
|
|`(% a b)`|Remainder of division|result of operation|
|
||||||
|
|`(list ..)`|Create a list of values||
|
||||||
```bash
|
|`(insert list index element)`|Insert an element into a lis.Indexed from 0|new list with value inserted|
|
||||||
$ ./ml -f "examples/hello_world.lisp"
|
|`(index list index)`|Return element at index in list|Element at index|
|
||||||
Hello world!
|
|`(remove list index)`|Remove a value at an index from a list|List with element removed|
|
||||||
```
|
|`(len list)`|Get the length of a list|list length|
|
||||||
|
|`(push list element)`|Add an item to the end of a list|new list with element added|
|
||||||
Interpret from command line argument:
|
|`(pop ..)`|||
|
||||||
|
|`(head list)`|Returns first element of a list|First element|
|
||||||
```bash
|
|`(tail list)`|Return all elements of list except first one|List without first element|
|
||||||
$ ./ml -c '(print "Hello world!")'
|
|`(first ..)`|||
|
||||||
Hello world!
|
|`(last ..)`|||
|
||||||
```
|
|`(range ..)`|||
|
||||||
|
|`(map ..)`|||
|
||||||
|
|`(filter ..)`|`(filter (lambda (x) (> x 2)) '(1 2 3 4 5)) => (3 4 5)`||
|
||||||
|
|`(reduce ..)`|||
|
||||||
|
|`(exit ..)`|||
|
||||||
|
|`(quit ..)`|||
|
||||||
|
|`(print ..)`|||
|
||||||
|
|`(input ..)`|||
|
||||||
|
|`(random ..)`|||
|
||||||
|
|`(include ..)`|||
|
||||||
|
|`(read-file ..)`|||
|
||||||
|
|`(write-file ..)`|||
|
||||||
|
|`(read-url ..)`|||
|
||||||
|
|`(system-cmd ..)`|||
|
||||||
|
|`(ls-dir ..)`|||
|
||||||
|
|`(is-file? ..)`|||
|
||||||
|
|`(is-dir? ..)`|||
|
||||||
|
|`(parse-csv ..)`|||
|
||||||
|
|`(parse-json ..)`|||
|
||||||
|
|`(save-csv ..)`|||
|
||||||
|
|`(get-universal-time ..)`|||
|
||||||
|
|`(date-to-str ..)`|||
|
||||||
|
|`(str-to-date ..)`|||
|
||||||
|
|`(date-add ..)`|||
|
||||||
|
|`(debug ..)`|||
|
||||||
|
|`(display ..)`|||
|
||||||
|
|`(replace ..)`|||
|
||||||
|
|`(regex-search? ..)`|||
|
||||||
|
|`(int ..)`|||
|
||||||
|
|`(float ..)`|||
|
||||||
|
|`(eval ..)`|||
|
||||||
|
|`(type ..)`|||
|
||||||
|
|`(parse ..)`|||
|
||||||
|
|`(xx ..)`|||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue