Nested concepts

2021-09-26 Thread SFR0815
Thank you, shirleyquirk for your comments. Took me a while to get trough them. Ad `new-style concepts`: I have not yet looked into this. Is there any documentation (or alike) available yet? (Tried to find some ...) - Would really like to start using these rather sooner than later. Ad `somethi

Funny bug when list.map(fn) and list.map((v) => v.fn) would produce different results

2021-09-26 Thread alexeypetrushin
I was exploring some prices, and there was something unusual. Price rates calculated as `price(t+span)/price(t)` with `proc rates*(values: seq[float], span = 1): seq[float] =` function. And these two lines produced different results: prices.map(rates) prices.map((p) => p.rates)

Hot Code Reloading viability for Jupyter-Notebook like Nim IDE

2021-09-26 Thread alexeypetrushin
+1, and would be even better if REPL worked in compiled-to-JS too, so you have pure one page interactive Nim calculations.

Hot Code Reloading viability for Jupyter-Notebook like Nim IDE

2021-09-26 Thread Niminem
What's up guys, I've been playing around with the concept of a Jupyter-Notebook like Nim IDE for a while. I call it [Nim Notebook](https://github.com/Niminem/NimNotebook/) So far I've experimented with `nim secret` (currently the best, and the default), `inim`, and various implementations of em

Help needed - issue wrapping header with c2nim

2021-09-26 Thread mantielero
I wonder if the last line should be converted into something like: template DEFINE_STANDARD_HANDLECLASS*(C1, C2, BC: untyped): untyped = discard "forward decl of C1" type `Handle C1` = Handle[C1] Run and then I should replace `Handle_` with `Handle`

Ported hashing routines: blake2s, blake2b, xxhash

2021-09-26 Thread enthus1ast
there also is just that you know.

Closures inside loops without capturing loop variable?

2021-09-26 Thread Araq
> About JavaScript, as far as I know in JS this behavior (lack of scope for > if/for/etc statements) considered more like an unfortunate design mistake, > that would be nice to fix, but unfortunately it's impossible to fix due to > backward compatibility. Yes, I know, but please consider that w

Closures inside loops without capturing loop variable?

2021-09-26 Thread DIzer
mmm Alexey, I may do a mistake but the first example you post (before editing) has no locale within the lambda ... echo i as far as i know is equal echo(i) - just usual passing a parameter via a function interface - it makes a difference (for example in C++(since v.11+ ) it is not captured).So t

Closures inside loops without capturing loop variable?

2021-09-26 Thread DIzer
of course not - your link lead to (working) example from the sugar module. I still see no clear answer how to treat captures in lambda locales from the language position (yet i may not want to use the sugar module anyway and @Araq shows the way ).

Closures inside loops without capturing loop variable?

2021-09-26 Thread planetis
> more over i wonder if its properly covered in the Nim manuals. Its [documented](https://nim-lang.github.io/Nim/manual.html#closures-creating-closures-in-loops) Agreed though it's not the most intuitive thing and I had trouble learning it, as well.

Ported hashing routines: blake2s, blake2b, xxhash

2021-09-26 Thread icedquinn
Posted some hashing routines I'd worked on in the past online today. One of them is still broken but xxhash and blake hashes work and I've been using them to power hash tables for about a year now. May get ar

Closures inside loops without capturing loop variable?

2021-09-26 Thread alexeypetrushin
> variable should be captured by value and it did not so Yes, this is what confused me too. `let a: int = b` means that it's immutable and copied by value. > We changed it for better performance and better JavaScript interop. Can't comment about the performance. But as far as I know in JavaScri

Help needed - issue wrapping header with c2nim

2021-09-26 Thread mantielero
I am struggling with this header: [Standard_Handle.hxx](https://pastebin.com/PnSKAX2S). I hit several issues with it. I reported a couple of the issues: [parsing issue](https://github.com/nim-lang/c2nim/issues/223) and the most problematic one for me: [Token pasting operator `##`](https://gith

Closures inside loops without capturing loop variable?

2021-09-26 Thread DIzer
Yes. But if it is your "workabouts" (you say about)-it is unexpected and non intuitive for me (and as i see for the @trisub, and @alexeypetrushin) , more over i wonder if its properly covered in the Nim manuals. Yet of course I may not percept Nim good enough for it. But my example is about anot

block-level change default type of int literals?

2021-09-26 Thread jyapayne
I think the problem lies in capturing `asI` in a recursive proc. Not sure if the VM can handle that or if it's supposed to. I generally avoid writing procs that depend on captured variables in macros. You can work around this by rearranging the code like so: import std/macros