nim-in-action-code icon indicating copy to clipboard operation
nim-in-action-code copied to clipboard

Remove deprecated ident type, getNum -> getInt

Open dlesnoff opened this issue 3 years ago • 4 comments

I have, in chapter 9 about the config macro:

  • fixed import (json functions were used inside the macro)
  • Remove deprecated NimIdent type: NimIdent->string, object.ident -> object.strVal
  • getNum is now getInt
  • move away example under a when isMainModule section. It allows to test the file without having to comment them each time we use the macro in another file. Avoids to import the test along the macro.

Oh sorry for the branch choice, these changes have been added by ulterior versions than 1.2.6, I have run code with 1.6.6 (current latest stable).

dlesnoff avatar Sep 14 '22 13:09 dlesnoff

When did these changes become required for successful compilation? Do we need a new branch for that version?

dom96 avatar Sep 16 '22 20:09 dom96

Actually no, I have done testing with 1.2.6, I get the same warnings (deprecated since 0.18.1 !) and the same getNum error. Obviously, I got same error and warnings with ulterior 1.4.8 version.

dlesnoff avatar Sep 19 '22 14:09 dlesnoff

Do you get these as warnings or do they fail compilation? The branches only need to compile successfully.

dom96 avatar Sep 19 '22 22:09 dom96

I get one error because getNum() does not exist in the json library

dlesnoff avatar Sep 19 '22 23:09 dlesnoff