diff --git a/smnp.lang.md b/smnp.lang.md index e6f1348..2b00613 100644 --- a/smnp.lang.md +++ b/smnp.lang.md @@ -6,12 +6,6 @@ Constructors technically are nothing but functions. They just "emulate" real con Creates new `int` from other `int` or `float`. The construction is typically used in other stdlib modules to round `float` types down. -### Arguments -* value of `int` or `float` type - -### Output -* newly created `int` - ### Example ``` x = 3.14; @@ -30,9 +24,6 @@ Creates new `note` with given parameters. * `duration` - the denominator of fraction that determines the duration of note: `1 = whole, 2 = half, 4 = quarter, ...` * `dot` - an optional dot which extends the note duration by half of its value -### Output -* note of given parameters - ### Example ``` x = Note("Eb", 3, 16, true); @@ -55,9 +46,6 @@ durationNumerator == 0.25 * durationDenominator -> quarter note ``` * `durationDenominator` - as above -### Output -* note of given parameters - ### Example ``` x = Note("Eb", 3, 3, 32); @@ -68,12 +56,6 @@ println(x == @Eb3:16d); # true ## `typeOf(object)` Returns the type name of passed object. -### Arguments -* object - object of any type - -### Output -* type name of passed object as string - ### Example ``` println(typeOf(14)); # integer @@ -85,13 +67,7 @@ println(typeOf({ c -> @c, d -> @d })); # map # Methods ## `list.get(index: int)` -Returns list element of given index. - -### Arguments -* index - index of desired element. Note, that counting starts with 0. - -### Output -* element of list with given index. Throws an error if index is out of bounds. +Returns list element of given index or throws error if index is greater than `list.size - 1`. ### Example ``` @@ -101,13 +77,7 @@ println(lastElement); # 4 ``` ## `map.get(key: )` -Returns map element associated with given key. - -### Arguments -* key - key of value that is about to be returned - -### Output -* element associated with given key. Throws an error if key doesn't exist. +Returns map element associated with given key or throws an error if key doesn't exist in the map. ### Example ``` @@ -122,13 +92,7 @@ println(element); # world ``` ## `string.charAt(index: int)` -Returns string's character of given index. - -### Arguments -* index - index of desired character. Counting starts with 0. - -### Output -*character of given index. Throws an error if index is out of bounds. +Returns string's character of given index or throws error if index is greater than `string.length - 1`. ### Example ``` @@ -137,21 +101,4 @@ println(x.charAt(1)); # e ``` ## `.toString()` -Returns a string representation of any available object. - -### Arguments -_none_ - -### Output -* string representation of object - -### Example -``` -println(@Eb3:8d.toString()); # D#3:(3/16) - -println(typeOf(14.toString())); # string -println(typeOf("hello, world".toString())); # string -println(typeOf(true.toString())); # string -println(typeOf(@Gb3:16d.toString())); # string -println(typeOf({ first -> @c, second -> [1, 2, 3] }.toString())); # string -``` \ No newline at end of file +Returns a string representation of object.