Share, pass, tricks
Pass one toy, share toys, share stash, function definitions and calls.
Pass (exactly one toy to one friend)
Pass words: pass, passes, passed, toss, tosses, tossed + to.
| Line | Parses as | Need to know |
|---|---|---|
she passes a toy to the beagle | Pass[giver, beagle] | Moves 1 toy |
Share toys
Share words: share, shares, shared, split, splits + with.
| Line | Parses as | Need to know |
|---|---|---|
the labrador shares with the beagle and husky | Share toys | Integer split; remainder stays with giver |
Bimba shares with the dachshund | Share | Pet names work |
the labrador shares with the golden retriever | Share | Multi-word breeds |
Recipients: comma-separated (beagle, husky) or and-joined (beagle and husky).
Integer division rules: Runtime semantics.
Share stash contents
| Line | Parses as | Need to know |
|---|---|---|
the labrador shares her cookie jar with the beagle, husky | Share stash | Items become treats, split round-robin; stash cleared |
Tricks (functions)
Define: expects / expect … returns / return … bury (or end, etc.).
| Line | Parses as | Need to know |
|---|---|---|
add expects a b returns a plus b bury | FunctionDef one-liner | |
add expects a b returns a plus b + body + bury | FunctionDef + steps | Multiline body |
greet expects name returns nothing + bark name + end | returns null | nothing return type |
bark add with 2, 3 | Print + FunctionCall | Call with with |
Parameters are single words between expects and returns. Return expression can be any value expression.
Recursion
Multiline trick bodies work. Return value comes from the returns expression or the last value in the body before bury:
add expects a b returns a plus b bury
double expects x returns add with x, x bury
Bark has branches, loops, stashes, piles, math, and shared state. That is the usual esolang checklist. counter-tradition.woof in the repo is the Brainfuck-style inside joke. No formal proof at 2 a.m.
Expression grammar for trick args and returns: Expressions.
