Skip to content

Instantly share code, notes, and snippets.

@def-
Created February 11, 2016 00:58
Show Gist options
  • Select an option

  • Save def-/810ac9c2ee582a94f81b to your computer and use it in GitHub Desktop.

Select an option

Save def-/810ac9c2ee582a94f81b to your computer and use it in GitHub Desktop.
type
Container[T] = concept c
c.len is Ordinal
items(c) is T
for value in c:
type(value) is T
proc foo(x: Container[int]) =
for item in x:
echo item
foo(@[1,2,3,4])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment