Skip to content

Instantly share code, notes, and snippets.

@vihanb
Created June 13, 2016 04:43
Show Gist options
  • Save vihanb/618daba9094b6185ecbc7e13fd09da94 to your computer and use it in GitHub Desktop.
Save vihanb/618daba9094b6185ecbc7e13fd09da94 to your computer and use it in GitHub Desktop.
Cheddar paradigms examples
//@F
IO.printf("Hello, %s!", IO.prompt("Name:", "Please enter your name"))
//@OO
class Greeter(String: name?) {
ask -> self.name = IO.prompt("Name:")
say -> IO.printf("Hello, #{self.name}!")
}
export main() {
const Hello := Greeter::()
while !Hello.ask() {
print "Please enter your name"
Hello.ask()
}
Hello.say()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment