Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 14: Show default arguments for functions #55

Open
radar opened this issue Jan 2, 2019 · 1 comment
Open

Chapter 14: Show default arguments for functions #55

radar opened this issue Jan 2, 2019 · 1 comment

Comments

@radar
Copy link
Owner

radar commented Jan 2, 2019

In Chapter 13, we will show the documentation for Map.get/2, which has this title:

def get(map, key, default \\ nil)

The default \\ nil syntax is new to readers as of this point. It should probably be introduced in Chapter 6.

@radar
Copy link
Owner Author

radar commented Jan 2, 2019

Except:

a = fn (a \\ nil) -> "Hello #{a}" end
** (CompileError) iex:26: anonymous functions cannot have optional arguments
    (stdlib) lists.erl:1354: :lists.mapfoldl/3
    (elixir) src/elixir_fn.erl:19: :elixir_fn.expand/3

Probably something to show in Ch14 then.

@radar radar changed the title Chapter 6: Show default arguments for functions Chapter 13: Show default arguments for functions Jan 2, 2019
@radar radar changed the title Chapter 13: Show default arguments for functions Chapter 14: Show default arguments for functions Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant