小编use*_*324的帖子

有什么问题:is_number if true do 1 end

为什么将第二种形式解析为 2 个参数传递给 is_number?

is_number if true, do: 1
true

is_number if true do 1 end
** (CompileError) iex:42: undefined function is_number/2
Run Code Online (Sandbox Code Playgroud)

elixir

3
推荐指数
1
解决办法
102
查看次数

你可以在 iex 之外使用自省功能吗?

我可以在 iex 之外使用 i() 吗?还有其他只能在 iex 中访问的功能吗?

iex> i(3)
Term
  3
Data type
  Integer
Reference modules
  Integer
Implemented protocols
  IEx.Info, Inspect, List.Chars, String.Chars

bash> elixir -e "i(3)"
** (CompileError) nofile:1: undefined function i/1
(elixir 1.11.1) lib/code.ex:341: Code.eval_string_with_error_handling/3
Run Code Online (Sandbox Code Playgroud)

bash elixir

2
推荐指数
1
解决办法
41
查看次数

标签 统计

elixir ×2

bash ×1