concept example from the manual now works again
This commit is contained in:
parent
f6ff01572e
commit
3bcafb1c3a
5 changed files with 18 additions and 32 deletions
|
|
@ -12,7 +12,6 @@ e
|
|||
s
|
||||
t
|
||||
'''
|
||||
disabled: "true"
|
||||
"""
|
||||
|
||||
template accept(e: expr) =
|
||||
|
|
@ -22,10 +21,10 @@ template reject(e: expr) =
|
|||
static: assert(not compiles(e))
|
||||
|
||||
type
|
||||
Container[T] = concept C
|
||||
C.len is Ordinal
|
||||
Container[T] = concept c
|
||||
c.len is Ordinal
|
||||
items(c) is iterator
|
||||
for value in C:
|
||||
for value in c:
|
||||
type(value) is T
|
||||
|
||||
proc takesIntContainer(c: Container[int]) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue