Last active
March 16, 2019 15:56
-
-
Save patroclos/f10e87787336bf02c802165e0b43a60b to your computer and use it in GitHub Desktop.
tested with pony 0.27.0-95d94ac [release] on Windows 10
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
trait val Tr is Stringable | |
fun string(): String iso ^ | |
class val Y is Tr | |
new val create() => None | |
fun string(): String iso ^ => "Y".string() | |
// if this is only Tr, it won't crash | |
// it this is (Y | None), it won't crash | |
type Exp is (Tr | None) | |
//type Exp is (Y | None) | |
primitive Indirection | |
fun apply(): Exp val => Y | |
actor Main | |
new create(env: Env) => | |
// if this is set to Y, instead of Indirection(), it won't crash | |
let testerino: Exp = Indirection() | |
// if we dont run testerino.string(), it won't crash | |
env.out.print(testerino.string()) | |
env.out.print("One would assume that you'll see this line") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment