:ets.fun2ms for Elixir, translate functions to match specifications
Switch branches/tags
Nothing to show
Clone or download
Latest commit b964037 Aug 7, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Add record support (#17) Mar 5, 2018
test Add record support (#17) Mar 5, 2018
.formatter.exs Format code Nov 6, 2017
.gitignore Update .gitignore May 9, 2014
.travis.yml Add ex_doc and general clean up Feb 24, 2017
CHANGELOG.md Bump to 1.3.0 and support Elixir 1.0.0 Aug 30, 2014
README.md Add license to readme Aug 7, 2018
mix.exs Fix source_url in project (#18) Apr 13, 2018
mix.lock Update ex_doc Nov 6, 2017

README.md

ex2ms

Build Status

Translates Elixir functions to match specifications for use with ets. Requires Elixir 1.0 or later.

Usage

Add ex2ms to your Mix dependencies:

defp deps do
  [{:ex2ms, "~> 1.0"}]
end

In your shell write the following to get up and running to try ex2ms out:

mix deps.get
iex -S mix
iex(1)> import Ex2ms
iex(2)> fun do { x, y } = z when x > 10 -> z end
[{{:"$1",:"$2"},[{:>,:"$1",10}],[:"$_"]}]
iex(3)> :ets.test_ms({ 42, 43 }, v(2))
{:ok,{42,43}}
iex(4)> :ets.test_ms({ 0, 10 }, v(2))
{:ok,false}

License

Copyright 2013 Eric Meadows-Jönsson

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.