use 'using' instead of 'sig' keyword; cleans up new features a bit
This commit is contained in:
parent
554a3e9335
commit
c9966a3e17
20 changed files with 109 additions and 74 deletions
|
|
@ -5,15 +5,15 @@ discard """
|
|||
proc test(x: proc (a, b: int): int) =
|
||||
echo x(5, 5)
|
||||
|
||||
test(proc (a, b): auto = a + b)
|
||||
test(proc (a, b: auto): auto = a + b)
|
||||
|
||||
test do (a, b) -> auto: a + b
|
||||
test do (a, b: auto) -> auto: a + b
|
||||
|
||||
proc foreach[T](s: seq[T], body: proc(x: T)) =
|
||||
for e in s:
|
||||
body(e)
|
||||
|
||||
foreach(@[1,2,3]) do (x):
|
||||
foreach(@[1,2,3]) do (x: auto):
|
||||
echo x
|
||||
|
||||
proc foo =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue