June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
2
Task/Copy-a-string/ABAP/copy-a-string-2.abap
Normal file
2
Task/Copy-a-string/ABAP/copy-a-string-2.abap
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
DATA(string1) = |Test|.
|
||||
DATA(string2) = string1.
|
||||
2
Task/Copy-a-string/Crystal/copy-a-string.crystal
Normal file
2
Task/Copy-a-string/Crystal/copy-a-string.crystal
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
s1 = "Hello"
|
||||
s2 = s1
|
||||
|
|
@ -4,3 +4,15 @@
|
|||
(reverse c) ; Modifies c in place.
|
||||
|
||||
(assert (= s c) "Strings not equal.")
|
||||
|
||||
; another way
|
||||
; Nehal-Singhal 2018-05-25
|
||||
|
||||
> (setq a "abcd")
|
||||
"abcd"
|
||||
> (setq b a)
|
||||
"abcd"
|
||||
> b
|
||||
"abcd"
|
||||
> (= a b)
|
||||
true
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
var
|
||||
c = "This is a string"
|
||||
d = c # Copy of content into new string
|
||||
d = c # Copy c into a new string
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
my $original = 'Hello.';
|
||||
my $bound-ro ::= $original;
|
||||
say $bound-ro; # prints "Hello."
|
||||
try {
|
||||
$bound-ro = 'Runtime error!';
|
||||
CATCH {
|
||||
say "$!"; # prints "Cannot modify readonly value"
|
||||
};
|
||||
};
|
||||
# y $original = 'Hello.';
|
||||
#my $bound-ro ::= $original;
|
||||
#say $bound-ro; # prints "Hello."
|
||||
#try {
|
||||
# $bound-ro = 'Runtime error!';
|
||||
# CATCH {
|
||||
# say "$!"; # prints "Cannot modify readonly value"
|
||||
# };
|
||||
#};
|
||||
say $bound-ro; # prints "Hello."
|
||||
$original = 'Goodbye.';
|
||||
say $bound-ro; # prints "Goodbye."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue