OverflowDefect when executing fibonacci sequence with 'memoization'

2022-07-20 Thread Niminem
Ah, makes sense thanks man. I'm trying to learn recursion, dynamic programming and related concepts for a weird idea I have. Didn't even think about the value being too big for an int lol

OverflowDefect when executing fibonacci sequence with 'memoization'

2022-07-20 Thread doofenstein
I don't think it really has anything to do with your particular implementation. The fiboncci sequence grows very fast, so naturally at some point values won't fit an int in Nim (which is fixed in size to be equal to the size of a pointer, so likely 64-bit for you) has anymore. When So what are

Website probably not up-to-date for Nim installation

2022-07-20 Thread robertsteven
The use of DLLs helps break up code into modules, reuse code, use memory efficiently and reduce disk space. When a program uses a DLL, a problem called dependency can cause the program not to run. When a program uses a DLL, a dependency is created.

OverflowDefect when executing fibonacci sequence with 'memoization'

2022-07-20 Thread Niminem
Hey guys, Below is a code snippet for the fibonacci sequence with 'memoization', a technique that stores the results of previous calls to a function so that the function can return the stored result instead of recalculating the result. This makes executing the fibonacci sequence much more effic

Nim v1.6.6 support for Codewars

2022-07-20 Thread shirleyquirk
interestingly (disturbingly), [Esolang interpreter #3 Custom Paintfuck Interpreter](https://www.codewars.com/kata/5868a68ba44cfc763e8d) fails on 1.6 due to a perf regression. there's a maximum limit for all the tests to be run of 12s, and while previous solutions take maybe 9-10s, on 1.6 it

Nim v1.6.6 support for Codewars

2022-07-20 Thread phargob
I can start to go through them (after actually doing the katas) and make my best effort to fix them. Here is the first Wasn't much to do (random -> rand) and I slightly refactored the code a bit. If that is met with approval

Help writing a macro that can accept a list of arguments of any arbitary type

2022-07-20 Thread kaushalmodi
Thanks! You are right! I don't need a macro here. This works (and I think that that will work for my actual code as well). type Foo = object someInt: int someStr: string Bar = object someBool: bool someStr: string proc doSo

Help writing a macro that can accept a list of arguments of any arbitary type

2022-07-20 Thread Clonk
You don't need a macros to do that, you can directly use varargs with a proc call : proc printAllObjs(objs: varargs[string, doSomething]) = var str: string for obj in objs: str.add obj str.add("\n") echo str printAllObjs(foo, bar)

Help writing a macro that can accept a list of arguments of any arbitary type

2022-07-20 Thread kaushalmodi
I have a `proc` with `auto` argument type with works for any object type I pass to it. But I need to make 5 different calls of that proc for each object type. So I am looking for a way to optimize that, and this pseudocode is what I have: type Foo = object someInt: int

Nim v1.6.6 support for Codewars

2022-07-20 Thread shirleyquirk
i believe it is in large part the deprecation of `random`, which is used to generate random tests. replacing that with `rand` should fix most of these i expect.