/*** Copyright (C) 2015–2021 Developer Sam.** @author sam*/// Basic information of sam, written in samlang.// The code below is a well-typed samlang program.// Try it by yourself at// https://samlang.io/democlass List<T>(Nil(unit), Cons([T * List<T>])) {function <T> of(t: T): List<T> =Cons([t, Nil({})])method cons(t: T): List<T> =Cons([t, this])}class Developer(val name: string, val github: string,val projects: List<string>,) {function sam(): Developer = {val l = List.of("samlang").cons("...")val github = "SamChou19815"{ name: "Sam Zhou", github, projects: l }}}class Main {function main(): Developer = Developer.sam()}
$ dev-sam about
$ dev-sam projects
$ dev-sam tech-talks
$ dev-sam timeline