yet more improvements to readme

This commit is contained in:
Sander Hautvast 2021-03-04 21:52:11 +01:00
parent cc518efcb6
commit b540e13d07

View file

@ -7,10 +7,15 @@
The repl has the following syntax (It's work in progress, new capabilities will be added) The repl has the following syntax (It's work in progress, new capabilities will be added)
* arithmetic expressions: * arithmetic expressions:
* add, subtract, divide, multiply * add(+), subtract(-), divide(/), multiply(*) on scalars, vectors and matrices.
* variable declaration eg: ```a = 1``` * variable declaration eg: ```a = 1 + 2```
* ```remove(x)``` removes bindings (when it's an object (eg vector), removes it from the matrix) * ```remove(x)``` removes bindings (when it's an object (eg vector), removes it from the matrix)
* ```remove(@n)``` removes an object using it's assigned index (```n``` is a number) * ```remove(@n)``` removes an object using it's assigned index (```n``` is a number)
* By the way, values can be bound to a name (assigned to a variable), but you can always also refer to them using their id, using : ```@n```
* so ```a = vector(1,1)```
> > vector@0{x0:0, y0: 1, x:1, y:1}
* and then ```@0```
> > vector@0{x0:0, y0: 1, x:1, y:1}
* method calls: * method calls:
```a = vector(12, 1)``` ```a = vector(12, 1)```
> > vector@0{x0:1, y0: 2, x:12, y:1} > > vector@0{x0:1, y0: 2, x:12, y:1}
@ -18,7 +23,7 @@ The repl has the following syntax (It's work in progress, new capabilities will
commas are not mandatory. I'm planning to add a more mathematical notation for vectors: ```[1 2]``` commas are not mandatory. I'm planning to add a more mathematical notation for vectors: ```[1 2]```
* properties * properties
* ```a.type``` * ```a.type```
> > vector > > vector
* property lookup * property lookup
```a.x+1``` ```a.x+1```