tmteam
tmteam
``` y:(int,text) = (42,'vasa') f(x) = (x*2, x.toText(), x-1) (g,t,i) = f(42) ``` - Type definition: ($type1, $type2 ...) - No less than 2 types - Can be converted to...
Convertion `(int64|uint64)->bigint->real` Operators `All arithmetics and bitwise` Id `bigint (optional : int)` Clr type `BigInteger` Allow to choose prefered integer type for constant and integer operators ( use int as...
client type: 1) It has alias 2) it can be converted to any 3) it has "to text" operation 4) has default non null value (or has new() constructor) ```...
type optional-- : T | none 1) assume we have 'none' constant of type 'NONE' 2) optional type T is type that can be either T or NONE 3) T...
Signature of the exponentiation function: **(x:real, y:real):real The signature is as follows, because for integers, negative numbers, it is possible to use a negative degree (which will lead to floating-point...
``` a:char = /'c' t:text = [/'h', /'i', /' '] g:text = [/'a'../'z'] m:text = [1..10].map(rule it.toChar()) ```
``` # old syntax myFun(a:int, b:int):real = ... # new syntax: myFun(a:int, b:int)->real = ... ``` Old syntax still has to be valid.
Tupple: (1,2,3): (int,int,int) Function: rule(x,y)=... : rule(int,int)->int Structure: {a=.., b=...}: {a:int, b:int} so sounds reasonable, that array has the same syntax: ``` a: [int] = [1,2,3] ```
``` type user: { name: text, age:int} type arraa: [int] type tupka: (int, int, text) type choice: int | real | text type funka: fun(int,int)->text f(x:choice)->user = {...} m:arraa =...
``` f(x) = m = x*2 m+x -1 sf(a,b,c) = d = b**2 -4a*c return if(d>0) (-b+ 2*a, -b- 2*a) else none ```