From f48549b39683f4fd94c7e63f2edd1e019cfe40fd Mon Sep 17 00:00:00 2001 From: Sander Hautvast Date: Thu, 4 Mar 2021 21:43:43 +0100 Subject: [PATCH] more improvements to readme --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3de7123..0d4a467 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,15 @@ The repl has the following syntax (It's work in progress, new capabilities will be added) * arithmetic expressions: * add, subtract, divide, multiply -* variable declaration eg: a= ... - ```vector(1,2,3,4)``` adds a vector, ```vector(1 2)``` as well. The start is now the origin. - commas are not mandatory. I'm planning to add a more mathematical notation for vectors: ```[1 2]``` - * > > vector@0{x0:1, y0: 2, x:3, y:4} +* variable declaration eg: ```a = 1``` * ```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) * method calls: - ```a = vector(12,1)``` + ```a = vector(12, 1)``` > > vector@0{x0:1, y0: 2, x:12, y:1} +* ```vector(1 2)``` works as well. The start is now the origin. + commas are not mandatory. I'm planning to add a more mathematical notation for vectors: ```[1 2]``` + * > > vector@0{x0:1, y0: 2, x:3, y:4} * properties * ```a.type``` > > vector @@ -25,17 +25,18 @@ The repl has the following syntax (It's work in progress, new capabilities will > > 13 * drag vectors using the mouse pointer. You can change the vector arrows visually * lazy evaluation. The difference between ```c = a+b``` and ```c = "a+b"``` - is that the latter assigns to c a parsed expression that can always be evaluated later. + is that the latter assigns to ```c``` a parsed expression that can always be evaluated later. When you apply lazy evaluation and later update ```a```, the value for c will be reevaluated automatically. Combined with vector dragging, this way you can get an intuition for vector addition. Want to do the same for matrix multiplication and basis change. -* enter the following: + +* Example: enter the following, like in the screenshot: ``` a = vector(0.5, 0.5) b = vector(-1, 1) - c = "a+b" + c = "a + b" ``` -* and press enter. Then using the mouse pointer move a or b. Or try: ```a=2*a``` +* and press enter. Then using the mouse pointer move a or b. Or try: ```a = 2 * a``` This updates vector ```a``` to twice it's size. And, because ```c``` is defined lazily, it is updated as well!