Commit Graph
8002 Commits
Author SHA1 Message Date
José Valim 7a1ae92b42 Improve docs for Access
A lot of confusion in the previous docs was caused by
trying to explain both bracket-based and dot-based
syntaxes in the same place. This made sense at the time
because those syntaxes were not described elsewhere.
But now we can link to other resources and focus the
docs specifically in the Access module.
2019-01-24 12:53:55 +01:00
Wojtek Mach 5820888bc0 Standardize on iodata variable name, as this is what docs use 2019-01-23 23:25:41 +01:00
Wojtek Mach 3c0794b62e Convert private is_iodata macro to a private guard 2019-01-23 23:25:41 +01:00
Tobiasz Małecki e333434019 Agent moduledoc improvement (#8674) 2019-01-22 17:44:10 +01:00
Eksperimental 2d0a481557 Make documentation accurate in File.cp* functions (#8627) 2019-01-22 17:27:57 +01:00
Eksperimental 5bd907d126 Use hexadecimal notation in code points in tokenizer error msg (#8669) 2019-01-22 13:39:40 +01:00
Eksperimental 2b6b1d51e6 Improve documentation and info on charlists (#8645) 2019-01-22 09:01:09 +01:00
Eksperimental 3beaf09dfe Correct arity in List test (#8670) 2019-01-22 08:58:37 +01:00
Eksperimental b60c8b82be Correct verb tenses (#8667) 2019-01-22 08:56:38 +01:00
Eksperimental 2f943d84cd Name args in Range.disjoint?/2 (#8666) 2019-01-22 08:55:56 +01:00
Fernando Tapia Rico 4f9c6e6c01 Optimize generated code for catch-all else clauses (#8661)
Elixir's with is expanded into a series of nested cases. For
example, this code:

    with {:ok, a} <- fun_a(),
         {:ok, b} <- fun_b() do
      wa = fun_w(a)
      wb = fun_w(b)
    else
      error -> {:c, error}
    end

would be expanded to something similar to this:

    case fun_a() do
      {:ok, a} ->
        case fun_b() do
          {:ok, b} ->
            wa = fun_w(a)
            wb = fun_w(b)

          var1 ->
            case var1 do
              error -> {:c, error}
              var2 -> error({with_clause, var2})
            end
        end

      var1 ->
        case var1 do
          error -> {:c, error}
          var2 -> error({with_clause, var2})
        end
    end

The generated code can be optimized for else clauses that
only contain a single catch-all clause (a variable that would
bind everything). Applying this optimization, the code of the
example above would be:

    case fun_a() do
      {:ok, a} ->
        case fun_b() do
          {:ok, b} ->
            wa = fun_w(a)
            wb = fun_w(b)

          error ->
            {:c, error}
        end

      error ->
        {:c, error}
    end
2019-01-22 08:53:24 +01:00
Eksperimental e81f8c065c Simplify guards in List.ascii_printable?/2 (#8656) 2019-01-22 08:50:48 +01:00
Wojtek Mach 736a1ac906 Update Module.spec_to_callback to keep existing specs and copy docs (#8663) 2019-01-21 19:49:44 +01:00
Eksperimental f1eca78ca4 Improve docs in Module functions and raise errors (#8635) 2019-01-21 18:12:51 +01:00
Eksperimental 861cf504f0 Use "operating system" instead of OS (#8658) 2019-01-20 21:15:20 +01:00
Eksperimental 6fceb8caaa Add test to List.ascii_printable?/2 (#8655)
Add test that checks improper lists with limit
2019-01-20 19:23:09 +01:00
Eksperimental 5a217ee941 Fix indentation in doctests (#8654) 2019-01-20 19:17:01 +01:00
José Valim 9d77f5d8f6 Move code and macros to after processes and applications 2019-01-20 14:53:09 +01:00
farmio 209e6cb5a6 Fix a typo in the Library Guidelines page (#8651)
[ci skip]
2019-01-20 14:45:38 +01:00
Tyler Witt a3a0e25cf7 Update Kernel rounding documentation (#8648)
Updates Kernel.round/1 to describe what happens on half.
2019-01-20 09:08:41 +01:00
Saúl Cabrera 8d48a4399f Fix typo in Task docs (#8650) 2019-01-20 09:08:21 +01:00
Ali Farhadi 69cd698535 Fix docs for DynamicSupervisor.start_child/2 (#8647)
[ci skip]
2019-01-19 12:25:18 +01:00
José Valim 0ce62a2add Rely on IO.warn whenever possible 2019-01-18 14:59:20 +01:00
José Valim f5ff567ce5 Avoid dialyzer warnings on formatter, closes #8631 2019-01-17 10:52:37 +01:00
Roman Smirnov 4bdc4e4050 Fix parsing Markdown links for h function (fix #8629) (#8641) 2019-01-16 22:39:14 +01:00
Eksperimental 0da99435c3 Use ID and not id (#8639)
The command used to detect these entries:
ag -s "\b(?<![/:{_\[.])ids?(?![}:_\]])(?!\(\))(?!enti)(?!ea)(?!iom)(?!x)"  --elixir
2019-01-16 19:14:39 +01:00
Eksperimental 2142465fdc Add missing colon and backticks (#8638) 2019-01-16 16:04:52 +01:00
Eksperimental ac2ee78e91 Use PID instead of pid (#8628) 2019-01-16 15:39:39 +01:00
Eksperimental 57a15ec541 Add note to File.stat/2 and File.lstat/2 on optimization (#8632)
The note was taken from the :file.read_file_info/1 Erlang documentation.
2019-01-16 09:42:23 +01:00
Eksperimental d605600d3f Sort Module.__info__/1 options alphabetically (#8637) 2019-01-16 09:38:02 +01:00
Eksperimental 8dc218edc3 Mention Code.fetch_docs/1 and ExDoc in Module (#8634) 2019-01-16 09:31:28 +01:00
Eksperimental f451f9f63d Replace use of "item(s)" with "element(s)" in List module (#8633)
The usage of items and elements was mixed,
but Erlang refers to them as Elements,
and Enumerable also refer to them as elements,
so I took the liberty to standardize its usage.
2019-01-16 09:28:50 +01:00
Eksperimental 8b1dfe2d50 Standardize non-doctest example in Agent moduledoc (#8630) 2019-01-16 09:27:57 +01:00
Derek Kraan 0f1d094bd9 Use consistent variable naming in the docs (#8625) 2019-01-15 19:57:24 +01:00
Aleks Tkachenko 0a48866077 Fix typo in GenServer docs (#8623) 2019-01-15 10:59:09 +01:00
José Valim c5a3943e71 Address bootstrap issue 2019-01-15 00:29:05 +01:00
José Valim d54c3183d2 Format compatibilty table so it reads better online 2019-01-14 23:58:37 +01:00
José Valim a6e9de56db Allow __MODULE__.Something in a nested defmodule
Defining __MODULE__.Something in a nested defmodule would fail
to compile. This commit address this:

    defmodule Foo do
      defmodule __MODULE__.Bar do
        __MODULE__ == Elixir.Foo.Bar
      end
    end

Since `__MODULE__` expands to a fully qualified name `Elixir.Foo`,
the nested module must then be `Elixir.Foo.Bar`. This commit also
fixes an alias leakage that would happen under such scenarios.

Another possible interpretation would be for it to return `Foo.Foo.Bar`.
However, that would mean we would not be able to access the module
right below its definition using `__MODULE__.Bar`, which means its
`Foo.Foo.Bar` would be the incorrect choice.
2019-01-14 23:58:37 +01:00
Nikita Avvakumov 1f2140994c Fix typo in DynamicSupervisor.init/1 docs (#8622) 2019-01-14 22:19:50 +01:00
José Valim 085cb22352 Only perform behaviour checking if blaming 2019-01-13 13:29:52 +01:00
José Valim d7d49e1f58 Consistently forbid upcasting in calendar conversion functions 2019-01-12 09:47:55 +01:00
John Jacob 35b29c1644 Update typespec of drop to allow negative integer (#8614)
Drop allows negative integers for dropping from the end.
2019-01-11 22:29:51 +01:00
Eksperimental e8acfa6802 Update usage of Unicode characters in atoms, variables and friends (#8603)
Update the Syntax Reference as well as List.to_atom/1
and List.to_existing_atom/1
2019-01-09 13:28:30 +01:00
Bryan Paxton 61a12f4a53 Improve coverage of Version.Parser (#8607)
Added assertions to exists test to cover lines 409, 412, and 511
2019-01-09 13:13:44 +01:00
José Valim a5468c2faa Update CHANGELOG 2019-01-08 20:46:45 +01:00
José Valim 427c2aa3ec Revamp Elixir CLI (#8595)
This commit adds 6 new options to elixir CLI to aid releases:

  * `--pipe-to PIPEDIR LOGDIR` - invokes run_erl with daemon pipe and logs (only on Unix-like systems)

  * `--rpc-eval NODE COMMAND` - evaluates the given expression on the given node

  * `--boot FILE`, `--boot-var VAR VALUE`, `--erl-config FILE` and `--vm-args FILE` - which are equivalent to Erlang's `-boot`, `-boot_var`, `-config` and `-args_file`

We have also rewritten the CLI to only pass Elixir options to Kernel.CLI.
2019-01-08 20:44:43 +01:00
Petr Stepchenko 01fd5a53f3 Add File.rename!/2 (#8606) 2019-01-08 20:25:03 +01:00
José Valim 3e673ac134 Ensure we support counters in bitstring size vars 2019-01-07 22:31:31 +01:00
Fernando Tapia Rico b2c698d295 Provide better errors with invalid dates in Calendar.ISO (#8601) 2019-01-07 21:58:31 +01:00
José Valim 5648b4e438 Update Writing Documentation.md (#8599) 2019-01-07 21:58:11 +01:00