Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Copy-a-string/GAP/copy-a-string.gap
Normal file
13
Task/Copy-a-string/GAP/copy-a-string.gap
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#In GAP strings are lists of characters. An affectation simply copy references
|
||||
a := "more";
|
||||
b := a;
|
||||
b{[1..4]} := "less";
|
||||
a;
|
||||
# "less"
|
||||
|
||||
# Here is a true copy
|
||||
a := "more";
|
||||
b := ShallowCopy(a);
|
||||
b{[1..4]} := "less";
|
||||
a;
|
||||
# "more"
|
||||
Loading…
Add table
Add a link
Reference in a new issue