From 4ed8b34d0f05391acbbcb7fc3e51a32f16bcd2bd Mon Sep 17 00:00:00 2001 From: Flaviu Tamas Date: Sun, 1 Feb 2015 20:14:08 -0500 Subject: [PATCH] Fix #20 See #20 for context: > allows the procedure to be stored in a variable and called correctly (even with default parameters). > As said by Araq on IRC: >> 'procvar' doesn't do much [...] it's just another check for semantic checking. codegen is not affected. --- content/procvars.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/procvars.md b/content/procvars.md index 53c6ad1..12a6921 100644 --- a/content/procvars.md +++ b/content/procvars.md @@ -20,10 +20,10 @@ $ nim c -r filterclosure.nim @[64, 128, 256] ``` -Existing procedures can also be passed as functions, but only if they are annotated with the `{.procvar.}` pragma. +Existing procedures can also be passed as functions, but only if they are annotated with the `{.procvar.}` pragma. This is because there may be default parameters, which must be specially handled by the compiler. ``` nimrod proc greaterThan32(x: int): bool {.procvar.} = x > 32 echo powersOfTwo.filter(greaterThan32) -``` \ No newline at end of file +```