@def
Thank you.
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
@wizzardx and @Ar , it's wonderful to have this feature. Thanks for the
code snippets.
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)
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
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