Re: Python-like with, context managers, and the RAII pattern

2017-10-07 Thread Tiberium
cdunn2001: "There's actually a lot of places I'd really like to use "withAs" in, eg to make sure that resources are closed, but without needing to add a resource-specific "defer" line." So wizzardx will need to create a template like this for every type he'll use

Re: Python-like with, context managers, and the RAII pattern

2017-10-07 Thread cdunn2001
Since you don't want to dive into macros and you don't need anything super-generic, I think you're better off with @Benjaminel's idea: template withcd(newdir: string, statements: untyped) = let olddir = os.getCurrentDir() os.setCurrentDir(newdir) defer:

Re: "Cross-platform C" target for Nim?

2017-10-07 Thread Tiberium
wizzardx: yes, and nim uses niminst

Re: Hacktoberfest project contributions?

2017-10-07 Thread mratsim
Arraymancer was born in-between linalg and neo and is targeted at machine learning, with a focus on deep learning and computer-vision (and later speech and language hopefully). I started Arraymancer because you need 4-dimensional tensors for deep learning on images (Number of images, RGB

Re: Trying to write readable code, need help

2017-10-07 Thread mratsim
I agree, this:self makes code less grep-able. var vsl = self.vsl works because vsl is a ref type so the pointer is indeed copied but it points to the same (shared) data location.

Re: about locks and condition variables

2017-10-07 Thread mikra
Hi community, just my 2cents on that topic: I wrote a simple test (modified from the threads module doc) to explore the signalling behaviour. If signal is called first, the signal is not lost and a later wait() is not locking (on my machine). would be nice to share experience on other

Re: range - Warning: Cannot prove that 't' is initialized.

2017-10-07 Thread opqx
Thanks for the info.