syntax.ternary_operator
Value chosen with ? :.
Area 3, Logic; not declinable; the next step is usually the agent's.
A choice between two values is a match on the condition; the edit writes it.
type Count = Int { min: 0}type Size = Text {}function size(count: Count) -> Size { return count > 10 ? "large" : "small"}
error Jadpo chooses a value with match, not ? :
--> main.jadpo:8:23
|8 | return count > 10 ? "large" : "small" | ^ write a `match`
- reason
condition ? a : bchooses a value in JavaScript, Java, C#, Kotlin and Swift; Jadpo chooses between two values with amatchon the condition.- next
- Write
match (count > 10)with the armstrue -> "large"andfalse -> "small"(agent) - rule
- syntax.
ternary_ operator - help
- https://jadpo.
dev/docs/errors/syntax. ternary_ operator
Markdown for agents: /docs/errors/syntax.ternary_operator.md.Built from Jadpo main at aee2e8f.