Nitpick Syntactic Sugar Operator Family
Nitpick heavily utilizes punctuation-based operators as syntactic sugar to condense common boilerplate, particularly around error handling, null coalescing, and functional data flows.
1. Unwrapping and
Safety (The ? Family)
?: Safe Unwrap. If the preceding function returns aResulterror, swallow the error and assign the default value provided after the operator.??: Null Coalesce. If the preceding value isNIL, fallback to the right-hand value.?!: Emphatic Unwrap. If the precedingResultis an error, instantly invokefailsafe()passing it the hardcoded error code provided after the operator.?.: Safe Navigation. Only access the member property if the left hand side is notNIL.
2. Desugared Keyword Aliases
Nitpick allows short-hand symbolic aliases for some of
its explicit safety keywords. These desugar directly into
the keywords during the parsing phase: * ?| :
Desugars to defaults (used in complex
expression chains) * _? : Desugars to
drop (evaluate but discard the
Result<T>) * _! : Desugars
to raw (evaluate and extract the value from
Result<T>, ignoring the safety flag)
3. Data Flow (Piping)
Nitpick supports functional-style piping to pass the
result of one function directly into the argument of
another, avoiding deeply nested parentheses. *
|> : Pipe forward (pass LHS as first
argument to RHS) * <| : Pipe backward (pass
RHS as argument to LHS)
4. Ranges
..: Inclusive range (e.g.,1..10includes 10)...: Exclusive range (e.g.,1...10stops at 9)