Actually just three programming languages in a trenchcoat
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

string representation of set/record values

+30
+4
testsuite/string-representation/main.tri
··· 12 12 io::println!($"${'hello('world)}") 13 13 io::println!($"${[]}") 14 14 io::println!($"${[1, 2]}") 15 + let set_string = $"${[|1, 2|]}" 16 + assert set_string == "[|1, 2|]" || set_string == "[|2, 1|]" 17 + let record_string = $"${{| 'a => 'b, 'c => 'd |}}" 18 + assert record_string == "{|a => b, c => d|}" || record_string == "{|c => d, a => b|}" 15 19 }
+26
trilogy/src/stdlib/core.tri
··· 163 163 } 164 164 str <> "]" 165 165 } 166 + case typeof 'set { 167 + let mut str = "[|" 168 + let mut i = 0 169 + let arr = c::set_to_array!(val) 170 + while i < c::length!(arr) { 171 + str <>= $"${arr.i}" 172 + i += 1 173 + if i != c::length!(arr) { 174 + str <>= ", " 175 + } 176 + } 177 + str <> "|]" 178 + } 179 + case typeof 'record { 180 + let mut str = "{|" 181 + let mut i = 0 182 + let arr = c::record_to_array!(val) 183 + while i < c::length!(arr) { 184 + str <>= $"${arr.i.'left} => ${arr.i.'right}" 185 + i += 1 186 + if i != c::length!(arr) { 187 + str <>= ", " 188 + } 189 + } 190 + str <> "|}" 191 + } 166 192 else then c::primitive_to_string!(val) 167 193 168 194