Created
June 13, 2016 04:43
-
-
Save vihanb/618daba9094b6185ecbc7e13fd09da94 to your computer and use it in GitHub Desktop.
Cheddar paradigms examples
This file contains hidden or 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
//@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