Hello World,Plug-in,String 2 integer, which is the same as string2integer,Links-2-3-4..) when the sentence is a proposition,!) when the sentence is a claim, or?) when the sentence is an issue.,), which stands for logical AND, or;), which stands for logical OR.:) is used as a field access modifier:1 2 | Foo: bar ~~ Accessing field `bar` of object `foo` Foo: bar: baz ~~ Accessing field `baz` of field `bar` of object `foo` |
1 2 3 | Print "Hello, World!" nl Use object 'main' from 'console' as 'run' SELECT ['t1.foo', 't1.bar', 't2.baz'] FROM 't1' LEFT OUTER JOIN 't2' ON 'id' ORDER BY 'foo' |
Void object, representing void type is an ancestor of every other object.signum function:1 2 3 4 5 6 7 | Signum :=> integer (
Arg :=< integer
Arg > 0? = 1 ~~ If `arg` is positive, return 1.
Arg < 0? = -1 ~~ Otherwise, if `arg` is negative, return -1.
= Arg ~~ Otherwise, return the value itself.
~~ Can be either zero or false.
)
|
{}).1 2 3 4 5 6 7 8 9 10 11 12 13 14 | {
I := ``0 ~~ This is a local integer variable initialized to zero.
{
~~ Some code here. ~~
I = i + 1
I < 10? ... ~~ While `i` less than 10, repeat.
}
{
~~ Some code here. ~~
I = i + 1
I >= 20?! ~~ Exit when `i` greater or equal to 20.
... ~~ Repeat otherwise.
}
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | A := void ( ~~ `A` is a base object.
Foo := void ( ~~ `Foo` is a field of `A`.
F := 1 ~~ `Foo` contains field `F`.
)
Bar := foo () ~~ `Bar` is another field of `A`, which inherits `Foo`.
)
B := A ( ~~ `B` inherits `A`.
Foo = * ( ~~ `Foo` is overridden in `B`.
G := 2 ~~ `G` is a new field of `B: foo`.
)
)
B: bar: g ~~ Equals to 2. This is valid, because `b: bar` derived from `b: foo`,
~~ which has a field `g`.
|
1 2 3 4 5 6 7 | A := void (Foo := 1) B := void (Bar := 2) C := void & a & b C: foo ~~ Equals to 1, derived from `A`. C: foo @a ~~ A more precise specification of where `foo` came from. C: bar ~~ Equals to 2, derived from `B`. C: bar @b ~~ A more precise specification of where `bar` came from. |
1 2 3 4 5 6 7 8 9 | A := void ( Foo := 1 ) B := void ( @A := * (Foo = 2) ~~ An adapter of `B` to `A` declaration. ) b @@a ~~ An adapter to `A`. b: foo @a ~~ The field `Foo` of adapter to `A`. |
1 2 3 4 5 6 | Use namespace 'Console' ~~ Import symbols declared in `Console` module.
@Main :=> * { ~~ Declare the main object.
Print "Program executed" nl ~~ Print the message.
= 0 ~~ Return the code of success.
}
|