Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Compound-data-type/Erlang/compound-data-type.erl
Normal file
10
Task/Compound-data-type/Erlang/compound-data-type.erl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
-module(records_test).
|
||||
-compile(export_all).
|
||||
|
||||
-record(point,{x,y}).
|
||||
|
||||
test() ->
|
||||
P1 = #point{x=1.0,y=2.0}, % creates a new point record
|
||||
io:fwrite("X: ~f, Y: ~f~n",[P1#point.x,P1#point.y]),
|
||||
P2 = P1#point{x=3.0}, % creates a new point record with x set to 3.0, y is copied from P1
|
||||
io:fwrite("X: ~f, Y: ~f~n",[P2#point.x,P2#point.y]).
|
||||
Loading…
Add table
Add a link
Reference in a new issue