Skip to content

Commit

Permalink
add To-Do's in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
batt0s committed Oct 12, 2024
1 parent cc560b3 commit 8115770
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ I made Rizzy as a learning project. I followed Thorsten Ball's book “Writing A

Rizzy is language with 6 data types (`Integer`, `Float`, `Boolean`, `String`, `Array`, `Map`) and a `NULL`. Rizzy has first-class functions with closure. Everything in Rizzy is a expression (function) except def (Define) statements and return statements. So if you type `5` it's actually a expression that evaluates 5.

### Examples
## To-Do

- [x] Floats
- [ ] Error traceback
- [ ] Better terminal integration (use arrow keys on REPL)
- [ ] GTE ("<=") and LTE (">=")
- [ ] Comparing INTEGER and FLOAT
- [ ] INTEGER -> FLOAT and FLOAT -> INT
- [ ] AND ("&&") and OR ("||")
- [ ] Built-in function for formatting ("fmt()")



## Examples

With `def` keyword you can define variables and functions.

Expand Down Expand Up @@ -40,9 +53,9 @@ def mymap = {"name": "Rizzler", "version": 1};
mymap["name"];
```

#### Built-in Functions
### Built-in Functions

##### `puts` and `rizz`
#### `puts` and `rizz`

They have the same definition.
Prints the arguments in their own line and returs an null. So the use is just:
Expand All @@ -59,49 +72,49 @@ Rizzler: null

Notice that it says "null" in the end. It does not evaluate anything. So if you say `def a = puts("a");`, `a;` will give you `null`.

##### `exit`
#### `exit`

Exits the interpreter, with an optional exit status code (default=0).


##### `len`
#### `len`

Returns the length of the input as INTEGER. Takes 1 input, ARRAY or STRING.


##### `first`
#### `first`

Returns first element of an array. Takes an ARRAY as argument. Same as using `array[0]`.


##### `last`
#### `last`

Returns last element of an array. Takes an ARRAY as argument. Same as using `array[len(array)-1]`.

##### `head`
#### `head`

Returns the array without the last element. Takes an ARRAY as argument.


##### `tail`
#### `tail`

Returns the array without the first element. Takes an ARRAY as argument.


##### `push`
#### `push`

Takes 2 arguments. Takes an ARRAY as first argument and an Expression as second. Returns an ARRAY with result of the given expression as last element.


##### `pop`
#### `pop`

Takes 1 arguments and 1 optional argument. Takes an ARRAY as first argument and an Expression as second. Returns an ARRAY without the element with index of result of the given expression.

##### `pow`
#### `pow`

Takes 2 arguments. Takes two INTEGER. Returns an INTEGER. `pow(2,2)` = `4`

##### `sqrt`
#### `sqrt`

Takes 1 argument. Takes an INTEGER. Returns an INTEGER. `sqrt(4)` = `2`

Expand Down

0 comments on commit 8115770

Please sign in to comment.