Random Stuff

This commit is contained in:
2025-10-03 12:40:47 +01:00
parent a1bddc70dc
commit 508a2f502d
10 changed files with 236 additions and 107 deletions

View File

@@ -16,6 +16,7 @@ bool_f = false
nil_val = nil
# --- Strings and symbols
s1 = "double-quoted string with escape\nand interpolation: #{int_lit}"
s2 = 'single-quoted string with \\n literal'
@@ -382,15 +383,6 @@ hex = 0xff
oct = 0o755
bin = 0b101010
# --- Case with guards
val = 10
case val
when Integer if val.even?
case_guard = :even_int
else
case_guard = :other
end
# --- Ternary, safe nav, assignment forms
tern = val > 5 ? :big : :small
safe_len = nil&.to_s&.length