diff options
author | apense <apense@users.noreply.github.com> | 2015-06-15 16:27:53 -0400 |
---|---|---|
committer | apense <apense@users.noreply.github.com> | 2015-06-15 16:27:53 -0400 |
commit | 8c8e975bcd286b41e8308a6deab0f1d00849c681 (patch) | |
tree | ee03d55ad1ad1ad9866782b051be7af0eb603617 /doc/astspec.txt | |
parent | 3c9d655b883129765c3716c209dee5d38d72f8f6 (diff) | |
download | Nim-8c8e975bcd286b41e8308a6deab0f1d00849c681.tar.gz |
Added static types
I put this within the type section, but I'm not sure if it should go here. It has a broader use. Should it get its own section?
Diffstat (limited to 'doc/astspec.txt')
-rw-r--r-- | doc/astspec.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/astspec.txt b/doc/astspec.txt index 6b64e5b91..ef0c91bb8 100644 --- a/doc/astspec.txt +++ b/doc/astspec.txt @@ -878,6 +878,26 @@ AST: # ... ) +Static types, like ``static[int]``, use ``nnkIdent`` wrapped in +``nnkStaticTy``. + +Concrete syntax: + +.. code-block:: nim + type A[T: static[int]] = object + +AST: + +.. code-block:: nim + # ... within nnkGenericParams + nnkIdentDefs( + nnkIdent(!"T"), + nnkStaticTy( + nnkIdent(!"int") + ), + nnkEmpty() + ) + # ... Procedure declaration --------------------- |