Skip to content

Instantly share code, notes, and snippets.

@Buildstarted
Created September 29, 2012 19:20
Show Gist options
  • Select an option

  • Save Buildstarted/3804984 to your computer and use it in GitHub Desktop.

Select an option

Save Buildstarted/3804984 to your computer and use it in GitHub Desktop.
Possible ways to do conditionals inp parrot
conditional(condition) {
true > lots of statements
false > lots of other statements
default > "will be called when condition doesn't match anything else"
}
conditional(condition) {
a > some value
b > something else
c > blah blah
someotherstatementtype > result
}
conditional(Name) {
'ben' > 'your name is ben'
'not ben' > 'your name is not ben'
}
conditional(Name) {
'ben'
{
'your name is ben'
}
'not ben'
{
'your name is not ben'
}
}
essentially it's a switch statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment