Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
README | ||
====== | ||
|
||
Korat Golang Compiler, KGC. | ||
Copyright (c) 2011 Chanwit Kaewkasi / SUT. | ||
|
||
This program is a front-end compiler for 8g and GCCGO. | ||
It additionally supports the following language constructs | ||
- trait | ||
- case struct | ||
- pattern matching | ||
|
||
Trait | ||
===== | ||
|
||
type Object trait {} | ||
|
||
|
||
Case struct | ||
=========== | ||
|
||
type Something casestruct { | ||
left Object | ||
right Object | ||
} | ||
type SomeObject casestruct borrows Object {} | ||
|
||
|
||
Pattern Matching | ||
================ | ||
|
||
match s { | ||
case Something(x, SomeObject(y)): | ||
return Some(x,y) | ||
case Something(SomeObject(), x): | ||
return Some(x) | ||
} |