Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR ELIXIR

elixir new structs

iex> defmodule User do
...>   defstruct name: "John", age: 27
...> end

iex> %User{}
%User{age: 27, name: "John"}
iex> %User{name: "Jane"}
%User{age: 27, name: "Jane"}
Source by elixir-lang.org #
 
PREVIOUS NEXT
Tagged: #elixir #structs
ADD COMMENT
Topic
Name
5+9 =