Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,27 @@
defmodule ObjectCall do
def new() do
spawn_link(fn -> loop end)
end
defp loop do
receive do
{:concat, {caller, [str1, str2]}} ->
result = str1 <> str2
send caller, {:ok, result}
loop
end
end
def concat(obj, str1, str2) do
send obj, {:concat, {self(), [str1, str2]}}
receive do
{:ok, result} ->
result
end
end
end
obj = ObjectCall.new()
IO.puts(obj |> ObjectCall.concat("Hello ", "World!"))