Quick actions

cmd+k|ctrl+k

Navigation

Languages

Untitled

Snippet info

Language

Nim

Visibility

unlisted

Author

legacy-anonymous

Created

2017-04-08T14:53:02Z

Updated

2017-04-08T14:53:02Z

import macros

#[
Compare to the expresion newSeq[int](10), which is represented by the AST:
  StmtList
    Call
      BracketExpr
        Ident !"newSeq"
        Ident !"int"
      IntLit 10
]#

macro dseq(len : int) : untyped = 
  result = quote do:
    newSeq[int](`len`)

let a = dseq(10)
INFO