Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,7 @@
type Foo* = object
a: string
b: string
c: int
proc createFoo*(a, b, c): Foo =
Foo(a: a, b: b, c: c)

View file

@ -0,0 +1,3 @@
var x = createFoo("this a", "this b", 12)
echo x.a # compile time error

View file

@ -0,0 +1 @@
echo repr(x)

View file

@ -0,0 +1,11 @@
import typeinfo
for key, val in fields(toAny(x)):
echo "Key ", key
case val.kind
of akString:
echo " is a string with value: ", val.getString
of akInt..akInt64, akUint..akUint64:
echo " is an integer with value: ", val.getBiggestInt
else:
echo " is an unknown with value: ", val.repr