Starting in elixir 1.2 there is an i command in iex that will list the type and more of any Elixir variable. iex> foo = "a string" iex> i foo Term "a string" Data type BitString Byte size 8 Description This is a string: a UTF-8 encoded binary. It's printed surrounded by "double quotes" because all UTF-8 encoded codepoints in it are printable. Raw representation <<97, 32, 115, 116, 114, 105, 110, 1
One way that has been suggested to deal with double definitions of overloaded methods is to replace overloading with pattern matching: object Bar { def foo(xs: Any*) = xs foreach { case _:String => println("str") case _:Int => println("int") case _ => throw new UglyRuntimeException() } } This approach requires that we surrender static type checking on the arguments to foo. It would be much nicer t
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く