nim-cookbook icon indicating copy to clipboard operation
nim-cookbook copied to clipboard

Syntax for aliasing

Open wizzardx opened this issue 7 years ago • 2 comments

Hi there.

Nim doesn't have a built-in alias command to rename identifiers to something more convenient (eg, D lang has that). But it's possible to get the same effect by using template metaprogramming.

Here's a couple of links with more info on that:

https://forum.nim-lang.org/t/2390

https://github.com/nim-lang/Nim/issues/7090

https://forum.nim-lang.org/t/1515

Could you please add a section for how to do aliasing?

wizzardx avatar Jan 23 '18 11:01 wizzardx

+1. This is my biggest annoyance with nim right now

QuinnFreedman avatar Apr 27 '18 19:04 QuinnFreedman

But it's possible to get the same effect by using template metaprogramming.

it's not possible to do so reliably without the compiler patch in the linked PR https://github.com/nim-lang/Nim/pull/11822, see PR for details

timotheecour avatar Jul 30 '19 09:07 timotheecour