Quick actions

cmd+k|ctrl+k

Navigation

Languages

Expression + Value printer

Snippet info

Language

Nim

Visibility

public

Author

oderwat

Created

2016-04-23T20:09:10Z

Updated

2016-04-23T20:09:10Z

# http://forum.nim-lang.org/t/2217

import terminal

template echox(x: typed) =
    terminal.setForegroundColor stdout, fgRed
    echo x.astToStr
    terminal.setForegroundColor stdout, fgBlue
    echo x
    terminal.resetAttributes()

proc f(x = 3): int = x

echox 1 + 2 * f()
INFO