mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-24 09:40:52 +00:00
The syntax to pattern-match a message is a pretty heavy cognitive burden. Try to ease that by introducing a macro. The main coin-toss here is whether to include the "what you do with the message" expression within the macro, or to allow it to be a block that trails it. The main benefit of including the body inside the macro is that we can append an "else" clause that spits out an error message in case the template didn't match. The drawback is the awkwardness of putting curly braces inside the parens of the macro expansion. I think Rust coders are probably more OK with that awkwardness, even though I find it visually unappealing; and the benefit is that scalars sent to opcodes expecting blockingscalars (and vice versa) don't go to a "black hole" -- you'll get an error message. This error message will probably save someone an hour of debugging someday, so we'll go with the awkwardness. |
||
|---|---|---|
| .. | ||
| bin | ||
| src | ||
| assemble.ps1 | ||
| assemble.sh | ||
| build.rs | ||
| Cargo.toml | ||