Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,7 @@
(mut str "hello world")
(mut copy str)
(set copy "clone destroyed")
(print str)
(print copy)

View file

@ -0,0 +1,40 @@
D create or replace table t as (select 'This is a string' as s);
D from t;
┌──────────────────┐
│ s │
│ varchar │
├──────────────────┤
│ This is a string │
└──────────────────┘
# Now make two copies.
D create or replace table tt as (select s as s1, s as s2 from t);
D from tt;
┌──────────────────┬──────────────────┐
│ s1 │ s2 │
│ varchar │ varchar │
├──────────────────┼──────────────────┤
│ This is a string │ This is a string │
└──────────────────┴──────────────────┘
# Change s2 and then verify that s1 is unaltered
D UPDATE tt SET s2 = s2[1];
D from tt;
┌──────────────────┬─────────┐
│ s1 │ s2 │
│ varchar │ varchar │
├──────────────────┼─────────┤
│ This is a string │ T │
└──────────────────┴─────────┘
# Check that s and s1 are also still equal
D select s = s1 from t positional join tt;
┌──────────┐
│ (s = s1) │
│ boolean │
├──────────┤
│ true │
└──────────┘

View file

@ -0,0 +1,7 @@
10 A$ = "HELLO"
20 REM COPY CONTENTS OF A$ TO B$
30 B$ = A$
40 REM CHANGE CONTENTS OF A$
50 A$ = "WORLD"
60 REM DISPLAY CONTENTS
70 PRINT A$, B$

View file

@ -0,0 +1,6 @@
s =: "hello"
print s.Usecount
t =: s \ reference copy
print s.Usecount
u =: string (s _ 'x') clip upto -2
print (quote u), u.Usecount, s.Usecount