##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: September, 2016 # Modified: 2016-10-03/22:46-0400 ##+ # # copy.icn, Demonstrate the one-level copy function # link ximage record newrec(a,b,c) procedure main() i := copy(5) write("copy(5) is ", i) L := [[1,2], 3, 4] L2 := copy(L) write(ximage(L2)) write() write("Only one level copied:") R := newrec(1, 2, L) R2 := copy(R) write(ximage(R)) write() write("The inner list is a reference") write("Changing the original, changes the copy") L[1] := 5 write(ximage(R)) end