The nim tutorial that the Della-Vos group is slowly writing is here:
https://github.com/FemtoEmacs/nimacros
The main novelties are:
1 -- Example of nimscript, suggested by RSDuck and coded by SolitudeSF 2 -- Translation of Fibonacci's Cuniculorum Fabula from Latin to English, by Stephanie 3 -- Removed chapter on recursion by Peano due to typos and lack of English translation 4 -- Emacs editor was replaced with lem. Nim-mode originally coded by cxxxr was replaced by another one, coded by me
I would appreciate if somebody could send interesting examples of nimscript and macros. Proofreading is most welcome, since Della-Vos group has only 4 native English speakers that can put only 6 hours to this project a week. Many chapters are mere stubs, therefore it would be great if someone could send material on Nim and nimscript. In the Della-Vos group, there are a lot of people from Spanish speaking regions of the United State (Miami, California, etc.), from Canada and England. Therefore, you can send material in Spanish, Spanish Creole or French that I will provide the translation and the proofreading.
I have few NimScript tasks which you can see in my repo's README: https://github.com/kaushalmodi/nim_config/blob/master/README.org#list-available-tasks
Those tasks are defined in the config.nims in that repo.
Emacs editor was replaced with lem
That's sad.
As for using lem instead of emacs, the problem is that we could not find an emacs mode that works flawlessly for nim. The students tried nimrod-mode and nim-mode:
1 -- nimrod-mode does not highlight multiline comments.
2 -- nim-mode often fail in performing indentation. For instance, in the listing below, if I place the cursor in front of the colon and press <Enter>, the part of the text that is after the colon goes to the begining of the line:
proc fib(n: int): int =
var (r1, r2) = (1, 1)
for i in 2..n: (r1,r2) = (r1+r2, r1)
result= r1
The result of pressing <Enter> after the colon is the following:
proc fib(n: int): int =
var (r1, r2) = (1, 1)
for i in 2..n:
(r1,r2) = (r1+r2, r1)
result= r1
Interesting enough, indentation works in the absence of parenthesis. In the following list, if I press <Enter> after the colon, nim-mode indents correctly.
proc fb(n: int): int =
if n<2: result=1
elif n<3:
result=n
else:
result= fb(n-3)+fb(n-2)+fb(n-2)
proc fb(n: int): int =
if n<2:
result=1
elif n<3:
result=n
else:
result= fb(n-3)+fb(n-2)+fb(n-2)