News for hackers. Stuff that matters.
Re:Show HN: Verify JSON using minimal schema by oefrha on Thursday April 16, 2020 @04:10AM (#22887223)
Exclamation mark for optional is just weird. Question mark would be a lot more intuitive, unless there’s an origin story here I’m not aware of.
Re:Show HN: Verify JSON using minimal schema by angry_cactus on Thursday April 16, 2020 @04:23AM (#22887296)
Not sure of the exact motivation, but Swift uses exclamation mark to unwrap optionals.
Re:Show HN: Verify JSON using minimal schema by oefrha on Thursday April 16, 2020 @04:56AM (#22887448)
In Swift optional types are marked by a question mark (exactly as I suggested). Unwrapping an optional makes it non-optional, so the exclamation point has the opposite meaning.
Re:Show HN: Verify JSON using minimal schema by yusufnb on Thursday April 16, 2020 @02:58PM (#22892347)
Its updated now to work with ? syntax