Copy a string: Difference between revisions

Add ed example
(→‎Pascal: fix non-standard example containing multiple mistakes)
(Add ed example)
 
(3 intermediate revisions by 3 users not shown)
Line 575:
src$ = " world..."
PRINT dst$; src$</syntaxhighlight>
 
==={{header|SmallBASIC}}===
<syntaxhighlight lang="qbasic">
src = "Hello"
dst = src
src = " world..."
PRINT dst; src
</syntaxhighlight>
 
 
==={{header|True BASIC}}===
Line 636 ⟶ 645:
?(^same$+5) = ?(^source$+5)
PRINT same$</syntaxhighlight>
 
=={{header|Binary Lambda Calculus}}==
 
In BLC, every value is immutable, including byte-strings. So one never needs to copy them; references are shared.
 
=={{header|BQN}}==
Line 995 ⟶ 1,008:
t → "abc"
(eq? s t) → #t ;; same reference, same object
</syntaxhighlight>
 
=={{header|Ed}}==
 
Copies the current buffer contents in its entirety.
 
<syntaxhighlight>
,t
</syntaxhighlight>
 
Line 1,980 ⟶ 2,001:
writeStr(destination, source);
end.</syntaxhighlight>
 
=={{header|PascalABC.NET}}==
Strings in PascalABC.NET are references.
<syntaxhighlight lang="pascal" highlight="9,13,15">
begin
var s: string := 'Hello';
var s1 := s;
end.
</syntaxhighlight>
 
=={{header|Perl}}==
84

edits