Skip to content

Instantly share code, notes, and snippets.

@killme2008
Created October 23, 2015 04:14

Revisions

  1. killme2008 created this gist Oct 23, 2015.
    4 changes: 4 additions & 0 deletions my_sigis.exs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    defmodule MySigils do
    def sigil_i(string, []), do: String.to_integer(string)
    def sigil_i(string, [?n]), do: -String.to_integer(string)
    end