Re: perfomance of set/hashset operation between python and nim

2017-09-28 Thread scriptkiddy
@def Thank you.

Re: perfomance of set/hashset operation between python and nim

2017-09-28 Thread boia01
As mentioned in another thread, Python memoizes the hash value for strings, which yields faster processing for Set operations. You can easily do this yourself with Nim by creating an object with the pre-computed hash value: type HString = object str: string

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

2017-09-28 Thread pgmf
@wizzardx and @Ar , it's wonderful to have this feature. Thanks for the code snippets.

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

2017-09-28 Thread Tiberium
You can use defer for closing resources: [https://nim-lang.org/docs/manual.html#exception-handling-defer-statement](https://nim-lang.org/docs/manual.html#exception-handling-defer-statement)

Python-like context managers and

2017-09-28 Thread wizzardx
Hi there. I like the Python RAII pattern of "with" statements, alongside context managers. eg, this is nice: with open("test.txt") as f: print f.read() Closest thing to that I could find was the "withFile" example over in the second Nim tut. So I've tried to adapt

Automated testing of Nim programs

2017-09-28 Thread bobg
Gerard Holzmann has just published an article "Randomly Right": IEEE Software ( Volume: 34, Issue: 5, 2017 ) Holzmann worked at Bell Labs for about 20 years, then at NASA. He created the Spin system for model checking software systems. The article "Randomly Right" describes a software system