added system.locals

This commit is contained in:
Araq 2013-03-21 21:28:46 +01:00
commit c9ed846a43
7 changed files with 64 additions and 18 deletions

View file

@ -2548,3 +2548,10 @@ proc safeAdd*(x: var string, y: string) =
if x == nil: x = y
else: x.add(y)
proc locals*(): TObject {.magic: "Locals", noSideEffect.} =
## generates a tuple constructor expression listing all the local variables
## in the current scope. This is quite fast as it does not rely
## on any debug or runtime information. Note that in constrast to what
## the official signature says, the return type is not ``TObject`` but a
## tuple of a structure that depends on the current scope.
nil