Commit Graph
8897 Commits
Author SHA1 Message Date
Eksperimental c1a538e4a8 Make spec clearer for update functions in Map (#10223)
* It removes the concept of the "get" value
* Renames "initial" argument to "default"
* Makes use of the concept of "current value" which was already present in some
  functions, and uses this in the examples and the specs consistently
2020-07-23 08:57:49 +02:00
Eksperimental 2013b4dc34 Improve Kernel documentation (#10222) 2020-07-22 20:22:58 +02:00
Oliver Severin Mulelid-Tynes 760cf2ccb6 Update Map.update example to use full lambda syntax on first example (#10221) 2020-07-22 19:08:30 +02:00
Eksperimental 512594c08a Mention file:line in Already defined as ... error message (#10219) 2020-07-22 14:59:37 +02:00
Eksperimental 660fc86ede More improvements to operator docs (#10220) 2020-07-22 14:44:12 +02:00
Eksperimental 7b27ffa7de Improvements to operator functions and page (#10218) 2020-07-22 07:59:52 +02:00
Eksperimental b0b0f8e0fd Improve keyword list definition and introduce the concept of key (#10215) 2020-07-21 09:56:31 +02:00
Eksperimental d38a9b8112 Clarify use of Enum.member?/2 in in/2 operator (#10216) 2020-07-21 09:55:40 +02:00
Eksperimental 72f70de5fd Improve Operators documentation (#10217)
- Use "less-than", "greater-than", and "equal to" operators. This the actual name used by Wikipedia and Unicode.
- Give a name to every operator in Kernel.
- Minor improvements here and there.
2020-07-21 09:54:44 +02:00
Eksperimental 5834b14433 Raise ArgumentError in Keyword.keys when list is not a keyword list (#10214)
Previously it would return something like this:

** (FunctionClauseError) no function clause matching in anonymous fn/1 in Keyword.keys/1

    The following arguments were given to anonymous fn/1 in Keyword.keys/1:

        # 1
        {"fetch/2", {:fetch, 2}}

Closes #10010, and it improves 3fd68ef62a
2020-07-21 09:52:29 +02:00
Eksperimental d0ec4296ba Small rewording in Supervisor.Spec (#10212) 2020-07-20 23:19:25 +02:00
Eksperimental 4822cb230c Fix typo in comment (#10211) 2020-07-20 23:06:58 +02:00
Eksperimental 71503e07bd Update typespecs and enforce with and limit in Inspect.Algebra (#10205) 2020-07-18 17:01:28 +02:00
José Valim 92cf894756 Require a trailing underscore to consider it a compiler variable 2020-07-17 13:59:52 +02:00
Juha 854db25440 Fix markdown codeblock rendering issue (#10202) 2020-07-16 19:39:38 +02:00
José Valim ebc57cdd16 Revert "Add support for :hour and :minute time units (#10185)"
This reverts commit 35f6ff827c.
2020-07-16 18:35:45 +02:00
Fernando Tapia Rico fc6bf59462 Add List.Chars to bootstrap modules
If there is a compile error, Kernel.ParallelCompiler raises
`** (UndefinedFunctionError) function List.Chars.to_charlist/1 is
undefined (module List.Chars is not available)`.
2020-07-16 13:20:38 +02:00
Eric Meadows-Jönsson f80fedde81 Remaining map guards should add optional keys
Closes #10148.
2020-07-16 01:47:17 +02:00
José Valim 6228ade7d2 Do not warn if quotes are used on complex atoms
Atoms that have non-ascii characters or @ does not
require tokens. That's to streamline the developer
experience around examples :"foo@computer-name" and
:"hélló".
2020-07-15 20:10:31 +02:00
José Valim 08706cc490 Warn if a variable that looks like a compiler variable is unused (#10198)
Closes #10197.
2020-07-15 12:20:49 +02:00
Eksperimental 5e591ebfc6 Fix warnings detected by future version of ExDoc (#10195) 2020-07-15 12:20:19 +02:00
Henrik Nyh 41159e562f Remove incorrect arities in test descriptions (#10194)
These tests actually use get_and_update_in/3 and pop_in/2.

I removed the arities, rather than correcting them, since it seems
like unnecessary detail here.
2020-07-15 00:07:04 +02:00
Parker Selbert 35f6ff827c Add support for :hour and :minute time units (#10185)
This enhances time unit aware functions in the `Time` module so that
they can operate on `:hour` and `:minute`, along with standard
`System.time_unit/0` values. This eliminates the need to convert all
values to seconds, which allows more expressive time manipulation.

Along with changes to `Time.add/3` and `Time.diff/3`, this adds
a new extended `time_unit` type to `Time`.
2020-07-14 20:34:20 +02:00
Eksperimental 98f2201e6d Use "bytecode" instead of "byte code" (#10189) 2020-07-14 15:44:58 +02:00
José Valim 5fa00e5260 Clarify to_unix docs 2020-07-14 11:46:34 +02:00
Eksperimental b04089d9b9 Enforce typespec limitation in bitstring unit (#10187) 2020-07-14 08:11:37 +02:00
José Valim d135c7f8ca Add Date.day_of_week/2, beginning_of_week/2, and end_of_week/2 (#10181)
This augments the Calendar behaviour by adding
a new function, c:Calendar.day_of_week/4 which
supports a starting_on value with defaults and
calendar specific semantics.
2020-07-13 12:29:36 +02:00
Wojtek Mach 9f6e39d1b2 Update Date.range/2 to accept t:Calendar.date/0 (#10182) 2020-07-13 11:09:17 +02:00
Tomasz Marek Sulima c192083726 Add is_exception/1 and is_exception/2 guards (#10180) 2020-07-12 13:55:11 +02:00
José Valim b3d6aff7b6 Load config/runtime.exs in escripts 2020-07-11 18:30:46 +02:00
José Valim 7aa93b188c Improve compiler error message when using | in a def pattern 2020-07-11 10:22:28 +02:00
Daniele Megna 2885c01da8 Add missing subtract client function in calculator example (#10173) 2020-07-10 09:27:11 +02:00
Wojtek Mach ba0b09f0fb Add Date.beginning_of_month/1 and Date.end_of_month/1 (#10171) 2020-07-10 08:57:14 +02:00
José Valim faec14746f Add config_target() 2020-07-08 17:06:10 +02:00
Eric Meadows-Jönsson a122c512a9 Optimize variable unification (#10166)
Avoids building large chains of variable references by always resolving
to the last variable.

Instead of building a chain of references:

    var1 -> var2 -> ... -> varN -> type()

We now create a direction reference:

    var1 -> varN -> type()

This change vastly improves the speed of checking functions with high
complexity and many variables.
2020-07-08 15:02:46 +02:00
John Bampton de2010649d Remove trailing whitespace (#10164) 2020-07-08 09:01:02 +02:00
José Valim b2270699e1 Add config_env() and allow imports to be disabled in config files
Also used new functionality throughout Mix, including releases,
which will now prefer to load a config/runtime.exs file over
config/releases.exs.
2020-07-06 21:09:02 +02:00
Eric Meadows-Jönsson 801f52fc5d is_map_key/2 should add optional keys (#10156)
Closes #10148.
2020-07-06 17:14:30 +02:00
John Bampton 5e39868303 Remove trailing spaces from Markdown (#10150) 2020-07-04 19:12:02 +03:00
José Valim 284881c370 Undeprecate Keyword.replace/3 and Map.replace/3
Previously they were removed because they were seen
as alternatives to `update`, but it makes more sense
to see them as alternatives to `put`.
2020-07-04 13:06:02 +02:00
John Bampton 9699ec1c0e Remove extra blank lines from Markdown in some docs (#10149) 2020-07-04 09:10:03 +03:00
Eksperimental b792ae50c3 Display file:line in already defined type error message (#10145) 2020-07-03 08:32:51 +02:00
José Valim d8785b146c Sync port specs with Erlang, closes #10143 2020-07-02 17:21:24 +02:00
Denys Klymenko 402c3c51e6 Fix typo on macro docs (#10144) 2020-07-02 16:35:48 +02:00
Eric Meadows-Jönsson 1b7c4c3944 Improve map warnings (#10142) 2020-07-02 16:14:01 +02:00
José Valim 9a91cd5cb0 Add app.load task
Prior to this commit, application loading was scattered
around Mix, which lead to inconsistent behaviour.

We now always load the applications before compiling,
simplifying the logic on both app.start and in the
application tracer. This also paves the road to
config/runtime.exs, which needs all apps loaded
before they are started.
2020-07-02 15:17:48 +02:00
José Valim e2de345c26 Improve docs on map field access 2020-07-02 13:25:49 +02:00
José Valim 2ccef8c503 Avoid more escaping on Windows 2020-07-01 15:51:48 +02:00
José Valim 089d0cd6b6 Use macros instead of special casing in the compiler 2020-07-01 15:49:14 +02:00
José Valim 8895603c21 Improve coverage for types that look like built-in types, closes #10140 2020-07-01 15:18:49 +02:00