Commit Graph
1086 Commits
Author SHA1 Message Date
José Valim f8380e9dcd Get rid of unused _@MODULE var 2013-11-22 22:41:30 +01:00
José Valim 2655a318c2 Move some macros back to __op__ to work around bug in erl_eval 2013-11-22 15:42:12 +01:00
José Valim 398e0fd3fb Convert remaining operators 2013-11-22 14:39:11 +01:00
José Valim 1096cd00b9 Move arithmetic ops to Kernel 2013-11-22 13:29:02 +01:00
José Valim a6c19950a0 Merge pull request #1878 from pminten/intersperse
Enum.intersperse, change to join
2013-11-21 04:53:02 -08:00
Peter Minten e1ff60a57d Add Enum.intersperse 2013-11-21 13:45:41 +01:00
Eric Meadows-Jonsson fe3d1b1cfe Add Enum.reverse/2 2013-11-20 15:44:08 +01:00
José Valim e65eee49c4 Make inspect in general 20% faster
There are two main optimizations:

1. We have optimized Module.concat/2 (it is roughly 100% faster)
2. We have optimized rendering of Inspect.Algebra by skipping
   the intermediate s_doc representation. This reduces memory
   allocation and skips one extra pass on rendering.
2013-11-19 10:21:31 +01:00
Alexei Sholik 4358386906 Implement List.delete_at 2013-11-18 12:53:54 +02:00
Eric Meadows-Jonsson 985ce8e031 Switch Enum.drop/take behaviour for negative counts 2013-11-16 23:01:25 +01:00
José Valim cfa2aad8b4 Merge pull request #1868 from ericmj/typespecs
Add is_var/1 to typespecs and move guards to end of spec
2013-11-16 00:27:12 -08:00
José Valim c6a50d960e Improve coverage for streams with nested accs 2013-11-14 19:13:08 +01:00
Eric Meadows-Jonsson f125d19854 Move typespec guards to end of spec
Moves precedence of `when` to be lower than `::`.
2013-11-11 10:08:24 +01:00
Eric Meadows-Jonsson 1ce2e24f5d Add is_var/1 for use in typespec guards
Allows you to specify a variable without any type contraints.
2013-11-11 10:08:24 +01:00
parroty 4931629b51 Add :++, :-- and :** to Macro#binary_op_props 2013-11-10 22:25:42 +09:00
José Valim 0d3aa7fd66 Improve some Kernel error messages 2013-11-06 16:14:31 +01:00
José Valim 55ecdba77c Make test that changes global state sync 2013-11-06 15:00:00 +01:00
Eric Meadows-Jonsson d20190c99a Allow lower case escapes in URI
See RFC 2396 2.4.1
Closes #1857
2013-11-05 19:07:20 +01:00
José Valim e999642a8e Improve syntax error on invalid calls
Closes #1847
2013-11-04 12:32:17 +01:00
José Valim dcf6ca1003 Ensure LexicalTracker doesn't fail accross lexical contexts 2013-11-03 18:02:03 +01:00
José Valim 3a94bab1bb Get rid of useless fourth argument in defexception 2013-11-01 22:03:33 +01:00
José Valim 657054116b Add typespecs and to_string conversion to some IO APIs 2013-11-01 20:53:14 +01:00
José Valim aba0d5ba3f Simplify current module macro handling 2013-11-01 16:03:13 +01:00
José Valim d334c1d6e4 Add tests for LexicalTracker 2013-11-01 16:03:13 +01:00
José Valim d856e667b9 Add warnings for unused aliases 2013-11-01 16:03:12 +01:00
José Valim 3c151d5357 Add Kernel.LexicalTracker 2013-11-01 16:03:12 +01:00
Samuel Tonini 2e9f4196cd fix wrong error message for nil.func() call
The expected behavior for `nil.func()` should be:

    iex(1)> nil.test()
    ** (UndefinedFunctionError) undefined function: nil.test/0
       nil.test()

Also via cli `elixir -e`:

     $ elixir -e 'nil.test()'
     ** (UndefinedFunctionError) undefined function: nil.test/0
     nil.test()
     ....

Undefined function calls behave like:

    iex(1)> hello()
    ** (RuntimeError) undefined function: hello/0
2013-11-01 13:55:33 +01:00
Samuel Tonini 0134a8f394 remove whitespace 2013-10-31 21:55:39 +01:00
José Valim 821b7c6f76 Ensure Enum.member? uses match (===) 2013-10-31 11:36:05 +01:00
José Valim 9897b894be Deprecate x in y inside matches 2013-10-31 11:36:05 +01:00
José Valim 174f031efd Eval should take into account other contexts 2013-10-30 16:15:19 +01:00
José Valim f1e2fcf9f9 Same module variables must be explicitly shared
Prior to this commit, the following code would work:

    defmodule Hello do
      defmacro write do
        quote do
          a = 1
        end
      end

      defmacro read do
        quote do
          a
        end
      end
    end

    require Hello
    Hello.write
    Hello.read

Although this is convenient, it has many issues:

1. It is not clear at any point the intent of sharing the variables
   in between the macros

2. Whenever macros from the same module are nested, there is a chance
   a variable used before and after the nesting to be overriden

We address this issue by only allowing variables explicitly marked
with var! to be shared. Here is how the example above should be updated:

    defmodule Hello do
      defmacro write do
        quote do
          var!(a, Hello) = 1
        end
      end

      defmacro read do
        quote do
          var!(a, Hello)
        end
      end
    end

    require Hello
    Hello.write
    Hello.read
2013-10-30 16:15:19 +01:00
José Valim 992ac67512 Improve coverage for location: :keep 2013-10-30 16:15:19 +01:00
Peter Minten 6fbc92b088 Make unicode the default for regular expressions 2013-10-30 15:39:41 +01:00
José Valim 15d2d9f249 Impose === as the operator in the Set API 2013-10-29 12:16:08 +01:00
José Valim a31f180dd9 Impose === as the operator in the Dict API 2013-10-29 11:52:58 +01:00
John Warwick eee4351311 Cleaning up Version docs 2013-10-26 22:28:51 -04:00
José Valim 67ac77fdb3 Sigils can now handle balanced tokens as in %s(f(o)o)
Closes #1480
2013-10-26 14:08:04 +02:00
José Valim 0171e201fb Move parsing from elixir_interpolations to elixir_parser 2013-10-26 13:46:01 +02:00
José Valim 404f77421a Refactor string interpolation to delegate to the tokenizer
This refactoring helps us clean up the interpolation code and
guarantee it works as expected since it goes under the same
tokenization rules. It also helps provide better sigil handling
(going to be improved in upcoming commits).
2013-10-25 13:19:47 +02:00
José Valim 1e0daad1b1 Merge pull request #1803 from fishcakez/fix/try_else_support
Document try else clause
2013-10-24 13:40:53 -07:00
James Fish 446f5dc2c3 Document try else clause 2013-10-24 21:11:58 +01:00
elegua e63e4d44a3 Fixed interpolation per issue 1758 2013-10-24 11:25:34 -07:00
José Valim 2d8268cb8d Add Macro.pipe and Macro.unpipe 2013-10-24 12:55:58 +02:00
José Valim 5765db5919 Merge pull request #1774 from pminten/enum-slice-range
Add Enum.slice(coll, range)
2013-10-20 15:49:27 -07:00
Peter Minten 9a9fc7318c Add Enum.slice(coll, range)
By analogy to the new String.slice function.
2013-10-20 11:48:45 +02:00
José Valim 95e3fec729 Ensure Integer.parse and Float.parse do not accept double +, - and . 2013-10-20 10:54:11 +02:00
Carlos Brito Lage 3cc8e10525 Merge branch 'master' into fast-number-parsing 2013-10-19 15:16:26 -07:00
Carlos Brito Lage 8099754898 Added extra test coverage for float parsing 2013-10-19 15:13:28 -07:00
José Valim 4c2301b3a3 Improve String.slice implementation 2013-10-19 16:44:26 +02:00