Commit Graph
6128 Commits
Author SHA1 Message Date
Michał Muskała 63cea4f396 Add information about after clause timeout limit (#5942)
Source: http://erlang.org/doc/reference_manual/expressions.html#id80928
2017-03-31 08:47:08 +09:00
Xavier Noria 8f78ed51f8 Add a test suite for Integer.gcd/2 (#5945) 2017-03-30 11:38:04 +02:00
Xavier Noria 7faffcf477 Document the edge case Integer.gcd(0, 0) [ci skip] (#5944) 2017-03-30 11:29:55 +02:00
Aleksei Magusev a0b6612c71 Fix Integer.gcd/2 to not raise for zeros 2017-03-30 01:04:44 +02:00
Aleksei Magusev 002284efb9 Improvements to calendar modules 2017-03-30 01:04:44 +02:00
José Valim ddd92110a5 Simplify conversions by working on gregorian seconds 2017-03-29 11:37:56 +02:00
José Valim 582b6b9e90 Improve docs for Calendar's diff functions 2017-03-28 14:49:29 +02:00
José Valim a9471a3d6d Tidy up more calendar details 2017-03-28 14:43:06 +02:00
Qqwy / Wiebe-Marten 4eba8ccf3f Improve {(Naive)DateTime, Date, Time}.diff/2 (#5923) 2017-03-28 14:24:30 +02:00
Aleksei Magusev 553c342ddd Fix warning in doctest for Agent.start_link/2 2017-03-27 21:29:16 +02:00
Aleksei Magusev 7a435951d3 Fixes and improvements to Calendar modules 2017-03-27 21:28:36 +02:00
José Valim 1822cdbc8d Improve port docs, closes #5937 2017-03-27 17:29:45 +02:00
José Valim 9b614bb1a3 Example for error on agent start, closes #5936 2017-03-27 15:13:00 +02:00
Qqwy / Wiebe-Marten 8e11aacfcf Improve docs and specs for {(Naive)DateTime, Date, Time}.convert/2 (#5921) 2017-03-27 12:58:05 +02:00
Eksperimental 9711c6ff3a Be clearer explaining how to create a record with a customized tag (#5931)
Previously the tag name is the same name as the module the records is defined in,
so it may not be clear.
2017-03-26 09:26:56 -07:00
Aleksei Magusev e7db5d81c4 Small formatting improvement to Application.put_env/4 doc 2017-03-26 15:14:14 +02:00
Aleksei Magusev b3957a6b5b Improve naming of errors in elixir_expand 2017-03-26 15:14:14 +02:00
Aleksei Magusev c60ebb90bb Use "option" instead of "keyword" in error message for alias 2017-03-26 15:14:14 +02:00
Aleksei Magusev cc33b340b0 Improve test of discouraged types in TypespecTest 2017-03-26 15:14:14 +02:00
Aleksei Magusev 4a5822a90e Remove unnecessary calls to abs/1 2017-03-26 15:14:14 +02:00
Eksperimental d020b187a5 Remove unused import in Calendar.ISO (#5930)
Introduced in d017c5ab12.
2017-03-25 17:58:32 +01:00
Andrea Leopardi ed1c9489d4 Replace compile_error/4 with form_error/4 in elixir_erl_compiler (#5925) 2017-03-25 17:02:59 +01:00
Jeff Kreeftmeijer efa05882d0 Restore (deprecated) Integer.to_char_list/2 (#5928) 2017-03-25 14:05:54 +01:00
Michał Muskała 7034721ae9 Inline Map.replace!/3 and comments about inlining (#5922) 2017-03-25 13:44:01 +01:00
Andrea Leopardi 6311c0313e Properly document passing strings to Module.split/1 (#5927) 2017-03-24 14:17:02 -07:00
Andrea Leopardi f128d209d0 Minor improvements to the docs and specs in the Module module 2017-03-24 11:40:08 -07:00
Eksperimental eb0f3ea6eb Add typespecs and guards for the Module module (#5869) 2017-03-24 11:00:40 -07:00
Andrea Leopardi 97810dd836 Mention :sys.suspend/2 and :sys.resume/2 in the GenServer documentation
[ci skip]
2017-03-23 16:47:23 -07:00
José Valim c5a3ca4cdb Properly inline code and remove warnings 2017-03-23 19:01:13 +01:00
Qqwy / Wiebe-Marten 3f88ab745e {Map, Keyword}.replace/3 and replace!/3 (#5917) 2017-03-23 18:52:50 +01:00
José Valim 2d6e0fa476 Improvements to calendar 2017-03-23 18:37:30 +01:00
José Valim c6d3c8c1db Do not use _underscore_ notation on markdown
We don't use this syntax anywhere else in the codebase.
2017-03-23 17:59:19 +01:00
Qqwy / Wiebe-Marten d017c5ab12 Adds internal Calendar Rata Die format for conversions between Calendars (#5841) 2017-03-23 17:55:38 +01:00
Andrea Leopardi cd3e792ecd Use GenServer.stop/3 instead of :gen.stop/3 in Agent.stop/3 (#5915) 2017-03-23 08:35:57 -07:00
Andrea Leopardi b8371afbfb Replace compile_error/4 with form_error/4 in elixir_import (#5916) 2017-03-23 08:30:46 -07:00
Andrea Leopardi f9354b4c6d Polish the documentation for the Agent module 2017-03-22 19:14:20 -07:00
Andrea Leopardi 1d372e93ed Ensure Access.at/1 guards for integer index instead of just positive 2017-03-22 18:47:03 -07:00
Andrea Leopardi 0e06c36064 Polish the documentation for the Access module 2017-03-22 18:45:36 -07:00
Andrea Leopardi b32d37fbab Mention Erlang-style modules in the documentation for Module.split/1 2017-03-22 07:43:26 -07:00
Michał Muskała f046508497 Enum refactoring (#5818)
* Avoid do_ prefixing

* Refactor list functions to be body-recursive where sensible

  The reasoning is the same as in #3811 and 99e0d8e.

* Use recursive functions to optimize filter/reject for lists

  ----- With input: Big (10 Million) -----
  Name           ips        average  deviation         median
  tail          1.64      610.99 ms    ±13.78%      577.63 ms
  body          1.48      675.90 ms    ±10.06%      681.08 ms
  for           1.46      687.19 ms    ±12.84%      693.82 ms

  Comparison:
  tail          1.64
  body          1.48 - 1.11x slower
  for           1.46 - 1.12x slower

  ----- With input: Medium (100 Thousand) -----
  Name           ips        average  deviation         median
  tail        201.60        4.96 ms    ±15.12%        4.81 ms
  body        199.52        5.01 ms    ±14.03%        4.76 ms
  for         178.95        5.59 ms    ±14.50%        5.39 ms

  Comparison:
  tail        201.60
  body        199.52 - 1.01x slower
  for         178.95 - 1.13x slower

  ---- With input: Small (1 Thousand) -----
  Name           ips        average  deviation         median
  body       23.98 K       41.70 μs    ±38.90%       38.00 μs
  tail       21.35 K       46.84 μs    ±35.64%       44.00 μs
  for        18.64 K       53.63 μs    ±31.60%       50.00 μs

  Comparison:
  body       23.98 K
  tail       21.35 K - 1.12x slower
  for        18.64 K - 1.29x slower

* Add function guard to group_by/3 back

  It was used for dispatch between the new and deprecated version.
  The guard was erroneously removed in https://github.com/elixir-lang/elixir/commit/99e44a181fb3440ef572be2f9592c94aa0a99ebc#diff-6881431a92cd4e3ea0de82bf2338f8eaL1032.
2017-03-22 01:18:59 +01:00
Michał Muskała 37896aaa3e Perform only single enumerable dispatch on Enum.fetch (#5911) 2017-03-22 00:21:00 +01:00
Eksperimental d3f1fff8a9 Document and test function/0 built-in type (#5908) 2017-03-21 20:32:01 +01:00
Gal Tsubery 9d8ae7d287 Validate options for comprehension (#5907)
This change raises error when invalid keys are give to "for" loops and
prevents silent errors.
2017-03-21 19:41:08 +01:00
Gal Tsubery b8b8e4cd62 Clarify starting value in scan/2 documentation (#5906) 2017-03-21 19:28:02 +01:00
José Valim 99e44a181f Remove function guards as the BadArity and BadFunction reports provide more information than FunctionClauseError 2017-03-20 15:17:17 +01:00
Andrea Leopardi 605a804dc7 Improve docs for Process.link/1 (#5904) 2017-03-20 14:47:42 +01:00
Andrea Leopardi 52f6cb18aa Fix some minor things in docs for some functions in Kernel 2017-03-20 13:22:05 +01:00
Gal Tsubery 0cedfc70d0 Optimize Map.merge/3 by choosing merge direction (#5899) 2017-03-18 21:22:16 +01:00
Gal Tsubery 26e51edb92 Fix documentation of Kernel.use/2 (#5900) 2017-03-18 11:44:27 +01:00
Andrea Leopardi c47ddffedd Fix the behaviour of defdelegate/2 with default arguments (#5894)
When default arguements (\\) are used with defdelegate/2, a function is
generated for each default argument and each generated function calls the
delegate target function with the same arity. For example:

    defdelegate demonitor(monitor_ref, options \\ []), to: :erlang

will be expanded to

    def demonitor(monitor_ref), do: :erlang.demonitor(monitor_ref)
    def demonitor(monitor_ref, options), do: :erlang.demonitor(monitor_ref, options)

However, this seems to "break" the expectation that optional arguments set: when
a function has optional arguments, all the additional functions with lower arity
that are generated by the default arguments only call the function with maximum
arity with the default values provided for the optional arguments.

This means that if :erlang.demonitor/1 had a different behaviour than
:erlang.demonitor/2, then it would be hard to guess why because the expectation
is that demonitor(monitor_ref) only calls demonitor(monitor_ref, []), ending up
always to :erlang.demonitor/2.

This commit fixes this by leaving the signature of the functions to delegate
untouched (with optional arguments if present).
2017-03-16 19:25:23 +01:00