You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-1Lines changed: 62 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,67 @@ Too see the understand the keywords and their meaning, refer to [this file](http
14
14
<br>
15
15
There is semi working vscode extension for UMPL, you can find it [here](https://github.com/mendelsshop/UMPL_VSCode_Extension)
16
16
<br>
17
-
At UMPL to fix the null problem, we have invented a new type called hempty, which is the same as null, but it sounds better, and it adds to the long list of\ null like types across all the proggraming languages.
17
+
At UMPL to fix the null problem, we have invented a new type called hempty, which is the same as null, but it sounds better, and it adds to the long list of null like types across all the proggraming languages.
18
18
<br>
19
19
All bug reports head straight to /dev/hempty
20
+
21
+
# language-documentation
22
+
## Declarations
23
+
| name | description | usage | special keywords | special variables | example(s) |
24
+
|:---:|:---:|:---:|:---:|:---:|:---|
25
+
| create | creates a variable | create var-name with literal or expression| N/A | N/A|```create num-var with 5``` <br> ```create str-var with ((input `>> `))>``````create var with str-var```|
26
+
| list | creates a list | list var-name with [literal or expression literal or expression]| N/A | N/A|```list num-list with [1 3]``` <br> ```list str-list with [8, ((input `>> `))]```|
27
+
| potato | declares a function | potato emoji-name num-of-args ⧼code⧽| return literal-or-expression| for each argument you get `$argument-number` ie `$1` for the first one etc |```potato 😀 2 ⧼return ((plus $1 $2))>⧽```|
| if statement| if boolean is true do if code else do else code |if {boolean literal or expression} ⧼if code⧽ else ⧼else code⧽|N/A|```if {true} ⧼(`true`)>⧽ else ⧼(`false`)>⧽``` <br> ```if {not((true))>} ⧼(`true`)>⧽ else ⧼(`false`)>⧽``` <br> ```if {boolean-var} ⧼if {true} ⧼(`true`)>⧽ else ⧼(`false`)>⧽ ⧽ else ⧼(`false`)>⧽```|
33
+
| loop statement | loop until the code reaches break of continue |loop ⧼code⧽ |break, continue| ```loop ⧼ if {true} ⧼(`true`)> break ⧽ else ⧼(`false`)> continue ⧽⧽```
34
+
35
+
## Keywords
36
+
### To call a keyword you first need create an expression so ()> or ()>> or ()< and in the expression you put another pair of parentheses and the keyeword and its arguments.
37
+
| name | description| paremeters | returns | example(s) |
38
+
| :-: | :-: | :-: | :-: | :- |
39
+
| plus | if the first argument is a number, returns the sum of all the arguments, if its a string, each argument after is conctenated to the string, anything else wont work | any*1: argument | any |
40
+
| minus| sets the first parameter to the original value each next argument is subtract to it unless there is one argument in which case it is negated returning the negative value of it | number*1: argument | number |
41
+
|multiply| if the first arguments is string, multiplies the string by the next argument, if its a number, sets the first parameter to the original value each next argument is multiplied to it, any other thing does not work | any*1: argument | any |
42
+
|divide| sets the first argument to the original value each next argument is divided by the previous divisor | number*1: argument | number |
43
+
|not| returns true if the value is false, false otherwise |[boolean: value]| boolean |
44
+
|or| comapares value1 and value2 and returns true if either is true |[boolean: value1, boolean: value2]| boolean |
45
+
|and| comapares value1 and value2 and returns true if both are true |[boolean: value1, boolean: value2]| boolean |
46
+
|eq| compare two values if they are equal |[boolean: value1, boolean: value2]| boolean |
47
+
|ne | compare two values if not equal |[boolean: value1, boolean: value2]| boolean |
48
+
|gt| checks if the number1 is greater than the number2 |[number: number1, number: number2]| boolean |
49
+
|lt| check if the number1 is less than the number2 |[number: number1, number: number2]| boolean |
50
+
|le| checks if the number1 is less than or equal to the right number2 |[number: number1, number: number2]| boolean |
51
+
|ge| check if the number1 is greater than or equal to the number2 |[number: number1, number: number2]| boolean |
52
+
|addwith| adds value to variable in place, if the variable is a string anything can added to it, but if its a number only number can, anything cannot be added to |[variable: variable, any: value]| number |
53
+
|dividewith| divides value by variable in place |[variable: variable, number: value]| number |
54
+
|subtractwith| subtracts value from variable in place |[variable: variable, number: value]| number |
55
+
|multiplywith| multiplies value by variable in place, if variable is a string than the variable becomes the string value times, if the variable is a number we multiply the variable by the value, any other variable wont work |[variable: variable, number: value]| number |
56
+
|input| input with message |[string: message]| string |
57
+
|setwith| sets a variable to a value |[variable: variable , value*: any]| any |
58
+
|exit| exits with number provided |[number: number]| hempty |
59
+
|error| errors with error message provided |[string: message]| hempty |
60
+
|strtonum| converts string to number |[string: string]| number |
61
+
|strtobool| converts string to boolean |[string: string]| boolean |
62
+
|strtohempty| converts string to hempty |[string: string]| hempty |
63
+
|runcommand| runs os command |[string: command]| string |
64
+
|open| opens file |[string: file]| file |
65
+
|close| closes file |[file: file]| hempty |
66
+
|write| writes message to file with mode |[file: file, string: message, string: mode]| hempty |
67
+
|writeline| writes message to file at line with mode |[file: file, string: message, number: line, string: mode]| hempty |
68
+
|read| reads from file |[file: file]| string |
69
+
|readline| reads the line specified from the file |[file: file, number: line]| string |
0 commit comments