Re: Algorithms must decouple from containers

2018-03-24 Thread mashingan
I thought table can get the element with key while range got the element with index, to iterate between table and range is using pairs and items and their mutable variants. to iterate table, keys or values, can use iterator keys and values . > You missed my feature request "Make openarray a

Re: TechEmpower Web Framework Benchmarks: Round 10

2018-03-24 Thread mashingan
If they only wanted to know routing time, they should try nest too [https://github.com/kedean/nest](https://github.com/kedean/nest)

Re: How to dealloc complex object correctly?

2018-03-24 Thread mashingan
Isn't it making `ptr char` or `cstring` will immediately make it untraced?

Re: How to dealloc complex object correctly?

2018-03-24 Thread boia01
As to your question regarding `GCunref`, **yes** , it is needed for objects managed by Nim's GC (like the string example in the manual) when an untraced object (`ptr`) points to a traced object (`ref`) as you have in your example. You also need to be careful here. Your intention appears to be

Re: Algorithms must decouple from containers

2018-03-24 Thread lightness1024
Table doesn't work differently enough to break the iterable rules, what kind of ranges are you thinking about ? A range is a begin and an end iterator. Or otherwise said, one iterator with a "isFinished" method (since it is nim's choice). Soon they'll have next() if I understand correctly.

Re: Arbitrary Precision Integer Math Operators

2018-03-24 Thread mratsim
I'm pretty sure it's not planned for 1.0. Now due to the need of arbitrary precision floating point arithmetic for currencies/finance at Status, we wrapped mpdecimal, available [here](https://github.com/status-im/nim-decimal). Now the wrapper is below low-level and overload like `+` must be

Re: Algorithms must decouple from containers

2018-03-24 Thread mashingan
set is tailored for high performance hence it's only work with ordinal type. Are you perhaps thinking like this package? [https://nimble.directory/search?query=functional](https://nimble.directory/search?query=functional) Range in Nim usually is array and seq (cmiiw), and to support argument

Re: Nim syntax Quiz

2018-03-24 Thread lightness1024
not cool compiler message: [https://imgur.com/a/AcANV](https://imgur.com/a/AcANV) it'd be way better: "not nil only applies to ref types" maybe we should have a pinned threads about those.

Re: How to dealloc complex object correctly?

2018-03-24 Thread boia01
If your object was allocated with `allocShared0` then it must be de-allocated with `deallocShared`. [https://nim-lang.org/docs/system.html#allocShared0,Natural](https://nim-lang.org/docs/system.html#allocShared0,Natural)

Re:

2018-03-24 Thread dom96
Hrm, I don't consider this post to be insulting. It's a valid concern. Why do you think it's insulting? We will eventually have an official package repository, but the idea behind Nimble's design is to be decentralised at its core, the official repo will just be another mirror for packages.

Re: TechEmpower Web Framework Benchmarks: Round 10

2018-03-24 Thread bluenote
Doesn't the compiler pick up this file? [https://github.com/tbrand/which_is_the_fastest/blob/master/nim/jester/server_nim_jester.nim.cfg](https://github.com/tbrand/which_is_the_fastest/blob/master/nim/jester/server_nim_jester.nim.cfg)

How to dealloc complex object correctly?

2018-03-24 Thread r3d9u11
Hi. I have a complex object declared in shared memory: type SubObj = object idata: int fdata: float sdata: string MyObj = object title: string data: SubObj var lock: Lock var shrObj {.guard: lock.}: ptr MyObj

Re: About multi-line comments and string literal

2018-03-24 Thread timothee
works today: #[ comment ]#

Problem with nested try/raise/except

2018-03-24 Thread nimbo
Hi, I have the following test code which doesn't work as I expected. The first finally statement (echo "finally1") is never executed. All the other three echo lines are working. Have I misunderstood how exceptions should work? try: try: raise newException(Exception,