Enum types: Commas optional?

2017-01-28 Thread dmux
Are commas optional when declaring enumerated types? The following compiles and 
runs fine for me:


type
  Color = enum
red blue green purple


let col : Color = Color.red
echo col



Re: Nim concurrency

2016-12-30 Thread dmux
New location of the asyncdispatch documentation: 
[http://nim-lang.org/docs/asyncdispatch.html](http://forum.nim-lang.org///nim-lang.org/docs/asyncdispatch.html)


Question about using the

2016-12-21 Thread dmux
According to Part 1 of the Nim Tutorial,

> Traced references are declared with the ref keyword, untraced references are 
> declared with the ptr keyword.

and

> To allocate a new traced object, the built-in procedure new has to be used.

What happens if you do not use the **new** proc for a ref type? For example, I 
have the following code which compiles and runs fine:


type
  Node = ref object
name: string
left: Node
right: Node

proc newNode(name:string, left:Node = nil, right:Node=nil): Node =
  Node(name:name, left: left, right:right)

let rootNode = newNode("Grandpa")
let childNode1 = newNode("Uncle")
let childNode2 = newNode("Mother")
let grandchild1 = newNode("Sister")
let grandchild2 = newNode("Nimrod")

rootNode.left = childNode1
rootNode.right = childNode2
childNode2.left = grandchild1
childNode2.right = grandchild2


Since I defined my type using **ref**, but do not allocate a new traced object, 
is the object in this case untraced?