tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 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