update
This commit is contained in:
parent
1f1ad49427
commit
6f050a029e
2496 changed files with 37609 additions and 3031 deletions
3
Task/Copy-a-string/Aime/copy-a-string-1.aime
Normal file
3
Task/Copy-a-string/Aime/copy-a-string-1.aime
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
text s, t;
|
||||
t = "Rosetta";
|
||||
s = t;
|
||||
7
Task/Copy-a-string/Aime/copy-a-string-2.aime
Normal file
7
Task/Copy-a-string/Aime/copy-a-string-2.aime
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
data s, t;
|
||||
# Copy -t- into -s-
|
||||
b_copy(s, t);
|
||||
# Set -s- as a reference of the object -t- is pointing
|
||||
b_set(s, t);
|
||||
# or:
|
||||
s = t;
|
||||
14
Task/Copy-a-string/Racket/copy-a-string.rkt
Normal file
14
Task/Copy-a-string/Racket/copy-a-string.rkt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#lang racket
|
||||
|
||||
(let* ([s1 "Hey"]
|
||||
[s2 s1]
|
||||
[s3 (string-copy s1)]
|
||||
[s4 s3])
|
||||
(printf "s1 and s2 refer to ~a strings\n"
|
||||
(if (eq? s1 s2) "the same" "different")) ; same
|
||||
(printf "s1 and s3 refer to ~a strings\n"
|
||||
(if (eq? s1 s3) "the same" "different")) ; different
|
||||
(printf "s3 and s4 refer to ~a strings\n"
|
||||
(if (eq? s3 s4) "the same" "different")) ; same
|
||||
(string-fill! s3 #\!)
|
||||
(printf "~a~a~a~a\n" s1 s2 s3 s4)) ; outputs "HeyHey!!!!!!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue