What does the slash notation in Elixir mean? -


in elixir docs, keep using odd notation slash, example:

is_boolean/1 io.puts/1 string.length/1 is_function/2 ++/2 

i'm guessing, think refers arity. if that's case, why devil isn't mentioned anywhere in docs? it's not if kind of standard convention in (at least, not 1 i've ever seen in 20+ years in it).

from page 2, basic types of getting started documentation:

note: functions in elixir identified name , number of arguments (i.e. arity). therefore, is_boolean/1 identifies function named is_boolean takes 1 argument. is_boolean/2 identifies different (nonexistent) function same name different arity.

it described in erlang/elixir syntax: crash course:

here create module named hello_module. in define 3 functions, first 2 made available other modules call via export directive @ top. contains list of functions, each of written in format <function name>/<arity>. arity stands number of arguments.

i might speculate tends relegated side note in elixir literature because comes straight erlang. although erlang knowledge shouldn't necessary use elixir, such omissions common mistake when people document software derived elixir erlang.


Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -