Runtime constraints inspired by Yoruba spiritual prohibitions
Èw?` (Yoruba: "taboo/prohibition") defines runtime constraints that must be satisfied. If an èw?` is violated, the program panics with a clear error message. Think of them as spiritual guardrails for your code.
Unlike soft assertions, èw?` violations are fatal. Use them for invariants that must NEVER be broken.
Assert that a condition is true. Panics if false.
// Simple assertion
ayanmo age = 25;
ewo age >= 0; // OK
ayanmo balance = -100;
ewo balance >= 0; // PANIC: Taboo violated!
Assert with a custom error message.
ayanmo users = [];
ewo users.len() > 0, "User list cannot be empty";
// If empty: PANIC: Taboo violated: User list cannot be empty
English alias for ewo.
// Both are equivalent:
ewo x > 0, "x must be positive";
assert x > 0, "x must be positive";
Check inputs at function start.
ise divide(a, b) {
ewo b != 0, "Division by zero forbidden";
padap? a / b;
}
Verify results before returning.
ise sqrt(n) {
ewo n >= 0, "Cannot sqrt negative";
ayanmo result = Obara.sqrt(n);
ewo result >= 0, "sqrt must be non-negative";
padap? result;
}
Ensure conditions hold during iteration.
ayanmo i = 0;
nigba (i < 100) {
ewo i >= 0, "Loop counter went negative!";
// ... loop body
ayanmo i = i + 1;
}
Validate data types at runtime.
ise process(data) {
ewo Ogbe.type(data) == "list", "Expected a list";
ewo data.len() <= 1000, "List too large";
// ... process data
}
In Yoruba tradition, èw?` are sacred prohibitions — things that must never be done. Breaking an èw?` brings spiritual consequences. In Ifá-Lang, breaking an èw?` brings program termination. Both serve the same purpose: enforcing boundaries that maintain harmony and correctness.