Skip to content

Instantly share code, notes, and snippets.

@technosophos
Last active December 24, 2015 14:29
Show Gist options
  • Select an option

  • Save technosophos/6813335 to your computer and use it in GitHub Desktop.

Select an option

Save technosophos/6813335 to your computer and use it in GitHub Desktop.
# Meme++: A Langugae For The Moment
## Control Structures
### iDontOften/butWhenIDo
Evaluates BLOCK when CONDITION is TRUE
```
iDontOften BOOLEAN_CONDITION
butWhenIDo {
BLOCK
}
```
### yuNo
Evaluates block when CONDITION is FALSE.
```
yuNo BOOLEAN_CONDITION {
BLOCK
}
```
In either block, if the condition fails, it can be followed by an optional (else) execution path:
```
yuNo BOOLEAN_CONDITION {
BLOCK
}
areUKiddingMe {
BLOCK
}
```
## Error Handling
When an error is fatal, the `tableflip()` built-in should be called to begin unwinding the function stack:
```
yuNo doSomething() {
tableflip("RAGE!")
}
```
Unwinding can be stopped by trapping:
```
itsATrap tableflip("RAGE!") {
facepalm("Caught the rage.")
}
```
## Built-in Functions
Write to STDERR:
```
facepalm(MSG)
```
To handle assertions:
```
challengeaccepted(CONDITION)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment