(rontolisp) docs
← マクロ

typecase

(typecase x (integer body...) (string body...) (t default...))

x を一度だけ評価し、x が満たす型指定子を持つ最初の節を選択して、その節の本体を評価し、最後の値を返します。サポートされる型名は integerfloatnumberrationalstringsymbolkeywordconslistnullatomcharacterhash-tableboolean と、最後のデフォルト節としての totherwise です。複合指定子も使えます: (or ...)(and ...)(not ...)(member item...)(eql object)(satisfies function)、および (integer 0 9) のような範囲付き数値型です(詳細は check-type を参照)。どの節にも一致せずデフォルトもない場合、typecase は nil を返します。