Skip to content
/ ex2ms Public
forked from ericmj/ex2ms

:ets.fun2ms for Elixir, translate functions to match specifications

Notifications You must be signed in to change notification settings

y86/ex2ms

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}

About

:ets.fun2ms for Elixir, translate functions to match specifications

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%