Cali-Lang is a programming language created in 2015.
#2180on PLDB | 9Years Old |
git clone https://github.com/cali-lang/cali.lang.base
Base implementation of Cali interpreter.
include console;
include net.rpc;
include rpcDemoObj; // Include demo object.
class rpcDemoServer : rpcServer
{
public main(args)
{
rd = new rpcDemoServer();
console
.println('Starting up rpcDemoServer on localhost:9090')
.println('Hit ctrl-c to kill the server.')
.println('Waiting for calls ...\n')
;
rd.start();
}
cart = [];
public rpcDemoServer()
{
this // Hosted methods
.add('addToCart')
.add('getCart')
;
}
public addToCart(object Item)
{
if(Item instanceof 'rpcDemoObj')
{
console.println("Adding item '" + Item.getModelName() + "' to cart.");
this.cart @= Item;
return true;
}
else { throw "Unexpected object found."; }
}
public getCart()
{
console.println('Returning shopping cart.');
return this.cart;
}
}