Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cjen07/prefix
the world is your playground, ∀ Q, ∃h, ∀ f, g ∈ Q, s.t h(f, g) "then" f ≡ g + f
https://github.com/cjen07/prefix
Last synced: 10 days ago
JSON representation
the world is your playground, ∀ Q, ∃h, ∀ f, g ∈ Q, s.t h(f, g) "then" f ≡ g + f
- Host: GitHub
- URL: https://github.com/cjen07/prefix
- Owner: cjen07
- Created: 2017-06-27T18:38:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-24T08:24:26.000Z (over 7 years ago)
- Last Synced: 2024-09-19T09:19:12.271Z (about 2 months ago)
- Language: Elixir
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prefix
## "add" g to f
```elixir
defmodule Q do
def i() do
:ok
enddef f() do
IO.puts "world"
enddef g() do
IO.puts "hello"
enddef f(a) do
IO.puts a
enddef ff() do
f()
f()
endend
``````elixir
iex -S mix
Q.f
# => world
# => :ok
Q.f "cjen07"
# => cjen07
# => :ok
Q.ff
# => world
# => world
# => :ok
Z.h :f, :g
# => :ok
Q.f
# => hello
# => world
# => :ok
Q.f "cjen07"
# => hello
# => cjen07
# => :ok
Q.ff
# => hello
# => world
# => hello
# => world
# => :ok
Z.h :f, :i
# => :ok
Q.f
# => world
# => :ok
Q.f "cjen07"
# => cjen07
# => :ok
Q.ff
# => world
# => world
# => :ok
```## remark
* Z.h: without code change, reversible
* Z.i: with code change, irreversible