Skip to content

Instantly share code, notes, and snippets.

View bluenote10's full-sized avatar

Fabian Keller bluenote10

  • Bosch
  • Ludwigsburg, Germany
View GitHub Profile
@bluenote10
bluenote10 / notNilTest
Created April 30, 2015 13:25
Testing not nil
type
Test = object
field: seq[int] not nil
var t: Test
echo t.field.isNil() # true
@bluenote10
bluenote10 / gist:fc7907f2538606912799
Created April 29, 2015 14:52
Issues with Channel
import os, threadpool
proc spawnBackgroundJob[T](f: iterator (): int): TChannel[T] =
type Args = tuple[iter: iterator (): T, channel: ptr TChannel[T]]
#type Args = tuple
# iter: iterator (): T
# channel: ptr TChannel[T]
proc threadFunc(args: Args) {.thread.} =