I really hope, that for release 0.9.6 we would get some more examples about file processing. Maybe I missed something, I have read not all of the tutorial and the mim by example yet, but have not really found much about 'best practice' of file processing. Most I found was from Rosetta Code, but it was not much and uncommented. The topic came from a question of how to compare two files in C -- google points me to http://www.c4learn.com/c-programs/c-program-to-compare-two-textdata-files-in-c-programming.html and I asked myself how I would do this or similar tasks in Nim. Generally I think that file processing is an important point for each programming language, for example ease of use, handling read/write errors, EOF and automatically closing files. I guess most will be available in the manuall, but some best practice examples would make it easier for beginners. One final note: May there be a problem with doc generator and backtics in strings? In http://build.nimrod-lang.org/docs/streams.html#readChar,PStream we have "Returns '0' as an EOF marker." for proc readchar. Without a backtick in front of 0. In the source we have the backtick result = '\0'
Edit
s/backtick/backslash/g
2014-09-25 23:09:12

There are examples of basic file handling in the manual

Indeed, I missed that -- I should really read the whole manual when 0.9.6 is available...

But of course a topic "Files" in Nim by Example would be nice.

For that "Nim by Example" -- we have in http://nimrod-by-example.github.io/oop/ the statement: "Methods work in the same was as procs, including UFCS,". I would suggest s/was/way/ and maybe explain UFCS, guess it is not really a common term. (found that with google on D-lang pages only).

2014-09-26 11:27:08

You can save a lot of time just reading the manual. It's much easier, than gather info by pieces or make guesses. All the more the manual is not large and quite good (clear) written.

Maybe it should be renamed to "tutorial", people seem not to like the word "manual".

For the start you can skip some sections, like "Grammar", but e.g. procedure's syntax should be useful for you: http://nimrod-lang.org/manual.html#method-call-syntax_toc (about UFCS).

2014-09-26 12:10:00

people seem not to like the word "manual"

Its pretty funny to me, actually. The reason I generally avoid manuals is because many manuals give the barest explanation for something with an abstract syntax description and no examples. In fact, many manuals (not all) for programming languages have actually left out very important information and context that you really could not possibly deduce from the syntax description and small amount of information given. Or, the manual will give the most concise explanation possible.

Actually, the last few years manuals have gotten better. Its funny though, because I feel like I have actually been trained (by my experience) to avoid manuals. Nim's manual is pretty exceptional.

2014-09-27 03:27:41
Then indeed, people have reasons not to like the word "manual".
2014-09-27 14:33:51