Skip to content

Instantly share code, notes, and snippets.

@hanachin
Last active June 14, 2019 08:24
Show Gist options
  • Save hanachin/21f3b3c138f1b33b95d7241bf78e11cd to your computer and use it in GitHub Desktop.
Save hanachin/21f3b3c138f1b33b95d7241bf78e11cd to your computer and use it in GitHub Desktop.
using Module.new {
refine(Integer) do
def >(f)
f.call __method__
end
def <(f)
f.call __method__
end
def +(f)
f.call __method__
end
def -(f)
f.call __method__
end
def &(f)
f.call __method__
end
def |(f)
f.call __method__
end
def `(f)
f.call __method__
end
def ^(f)
f.call __method__
end
def !@(f)
f.call __method__
end
def ~@(f)
f.call __method__
end
def +@(f)
f.call __method__
end
def -@(f)
f.call __method__
end
def =~(f)
f.call __method__
end
def !~(f)
f.call __method__
end
def >>(f)
f.call __method__
end
def <<(f)
f.call __method__
end
def [](f)
f.call __method__
end
def []=(f)
f.call __method__
end
def >=(f)
f.call __method__
end
def <=(f)
f.call __method__
end
def <=>(f)
f.call __method__
end
end
}
42 |>> -> { p @1 }
42 |>< -> { p @1 }
42 |>+ -> { p @1 }
42 |>- -> { p @1 }
42 |>& -> { p @1 }
42 |>| -> { p @1 }
42 |>` -> { p @1 }
42 |>^ -> { p @1 }
42 |>! -> { p @1 }
42 |>~ -> { p @1 }
42 |>+@ -> { p @1 }
42 |>-@ -> { p @1 }
42 |>=~ -> { p @1 }
42 |>!~ -> { p @1 }
42 |>>> -> { p @1 }
42 |><< -> { p @1 }
42 |>[] -> { p @1 }
42 |>[]= -> { p @1 }
42 |>>= -> { p @1 }
42 |><= -> { p @1 }
42 |><=> -> { p @1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment