Closed Vindaar closed 6 years ago
About "introduced blocks of let, var, const where applicable" - it's not really specified in the NEP-1, I also talked with dom96 about this - it's just a personal preference whether you should use blocks of var/let statements or not. But it's fine :)
Why did you change some procs to func though?
I simply started using func
more and more now that it's available (not only as an alias for proc
). I think it's really helpful to know a proc is {.noSideEffects.} (without having to write that pragma all the time :P).
Didn't do it everywhere yet, simply because I forgot, haha.
edit: basically the same reason why I love Nim for preferring let
over var
.
is this ready for merge?
Just let me rebase that on the (now merged) master and then I'd say yes.
Done, all good on my end.
Since I had some free time and you mentioned that you're still relatively new to Nim, I thought I'd change the code somewhat to make it more idiomatic Nim style, i.e. apply the style guide https://nim-lang.org/docs/nep1.html and the style of the standard library. I may be doing some non idiomatic things myself, so feel free to criticize (or just ignore it if you don't simply don't like it :) ).
What I changed:
var
declarations withconst
orlet
declarations, if possiblelet
,var
,const
where applicableresult
variables, where not used beforesince the compiler can also deduce it automatically here.
argument:type
.Note: this PR is based on PR #4, so that should be merged before hand (if you decide to merge this anyways ;) ). I hope you don't mind me doing this. :)