/* Copyright Smallscript Corp (c) 2016 Author: David Simmons Subject: TCL/TK Talk on TSL */ include Ansi; //{ Base type func^ Talk(...) &{ prototype: { greet-everyone: method^ () { putml "$Ansi.{cls}$Ansi.{lt-blue}$this.event$Ansi.{normal} $this.time" "$Ansi.{lt-yellow}$this.talk$Ansi.{normal} $what $Ansi.{lt-green}$this.presenter$Ansi.{normal}"; }, }, @body: { this.event = "TCL/TK Conference"; this.talk = "Unknown"; this.time = date-now-utc-ms(); this.presenter = "Unknown"; var what = {talk presented by}; }} //} //{ My specialization func^ MyTalk(title) &{ super: Talk, @body: { super(...); this.talk = title; this.presenter = "David Simmons"; }} //} var talk = new MyTalk("TSL Language Tour Now"); talk.greet-everyone(); //{ Some other fun examples proc Example() { foreach(&value, &key, query({?builtins})) { putl $key; } } //Example; //putl [json-out [query ?builtins]]; //throw("Some error here"); //throw(&{what:"some object here"}); //throw(&{@error: "Sheesh, an error?"}); //}