-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Summary
Although nim allows static functions that can be executed at compile time, what it lacks (and exists in other languages) are static data types.
At present it is possible to get around this with:
var global_variable: string
proc some_function(value: string) =
if global_variable == "": global_variable = value
return global_variable
But it would be tidier (i.e. not polluting the global namespace) if one could code the same as thing as:
proc some_function(value: string) =
static local_static: string
if local_static == "": local_static = value
return local_static
Description
Both for simple memorization and for cumulative totals, and to do this without polluting global namespace.
Alternatives
No response
Examples
No response
Backwards Compatibility
No response
Links
No response
Metadata
Metadata
Assignees
Labels
No labels