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 @@
ret = {:ok, "fun", 3.1415}

View file

@ -0,0 +1,4 @@
elem(ret, 1) == "fun"
elem(ret, 0) == :ok
put_elem(ret, 2, "pi") # => {:ok, "fun", "pi"}
ret == {:ok, "fun", 3.1415}

View file

@ -0,0 +1 @@
Tuple.append(ret, 3.1415) # => {:ok, "fun", "pie", 3.1415}

View file

@ -0,0 +1 @@
Tuple.insert_at(ret, 1, "new stuff") # => {:ok, "new stuff", "fun", "pie"}

View file

@ -0,0 +1 @@
[ 1, 2, 3 ]

View file

@ -0,0 +1,8 @@
my_list = [1, :two, "three"]
my_list ++ [4, :five] # => [1, :two, "three", 4, :five]
List.insert_at(my_list, 0, :cool) # => [:cool, 1, :two, "three"]
List.replace_at(my_list, 1, :cool) # => [1, :cool, "three"]
List.delete(my_list, :two) # => [1, "three"]
my_list -- ["three", 1] # => [:two]
my_list # => [1, :two, "three"]

View file

@ -0,0 +1,10 @@
iex(1)> fruit = [:apple, :banana, :cherry]
[:apple, :banana, :cherry]
iex(2)> hd(fruit)
:apple
iex(3)> tl(fruit)
[:banana, :cherry]
iex(4)> hd(fruit) == :apple
true
iex(5)> tl(fruit) == [:banana, :cherry]
true