Sex of the holder, to be specified by use of the single initial commonly used in the language of the State where the document is issued and, if translation into English, French or Spanish is necessary, followed by an oblique and the capital letter F for female, M for male, or X for unspecified.
Machine Readable Zone
F = female; M = male; < = unspecified. ※<は比較演算子ではなく<を使えという意味。
booleanで指定されていたりして (スコア:0)
たいとるおんりー
Re: (スコア:2, 参考になる)
パスポートのフォーマット規約見ると、男と女と未指定の3値が規定されていた。
https://www.icao.int/publ [icao.int]
Re: (スコア:0)
TrueとFalseとnullが欲しいときがある。
ternary型?
Re:booleanで指定されていたりして (スコア:1)
Nullable型 [wikipedia.org]を使うんじゃない?
Re: (スコア:0)
ほうほう、最近?の言語(Kotlin/Swift等)には普通にあるのね・・・
Re:booleanで指定されていたりして (スコア:1)
C#が2005年のversion 2.0でサポートしてるし、
それ以前も動的型付け言語だと同じようなことはできるので、
それほど最近でもないかな。
Re: (スコア:0)
プログラミング言語・ライブラリによっては、ternary logicを実現するデータ型を(boolのnullableとは別に)用意していることもある。たとえばC++のBoostのtribool。
Re: (スコア:0)
便利やけど、覚えることがどんどん増えるな