next steps for closure iterators
This commit is contained in:
parent
85a5bfe605
commit
37229df7fc
28 changed files with 164 additions and 71 deletions
|
|
@ -1,31 +0,0 @@
|
|||
discard """
|
||||
file: "tstaticparams.nim"
|
||||
output: "abracadabra\ntest\n3"
|
||||
"""
|
||||
|
||||
type
|
||||
TFoo[T; Val: static[string]] = object
|
||||
data: array[4, T]
|
||||
|
||||
TBar[T; I: static[int]] = object
|
||||
data: array[I, T]
|
||||
|
||||
TA1[T; I: static[int]] = array[I, T]
|
||||
# TA2[T; I: static[int]] = array[0..I, T]
|
||||
# TA3[T; I: static[int]] = array[I-1, T]
|
||||
|
||||
proc takeFoo(x: TFoo) =
|
||||
echo "abracadabra"
|
||||
echo TFoo.Val
|
||||
|
||||
var x: TFoo[int, "test"]
|
||||
takeFoo(x)
|
||||
|
||||
var y: TBar[float, 4]
|
||||
echo high(y.data)
|
||||
|
||||
var
|
||||
t1: TA1[float, 1]
|
||||
# t2: TA2[string, 4]
|
||||
# t3: TA3[int, 10]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue