kota's memex

nimble (package manager)

install

nimble install nimble

Packages are fetched from a global package repository by default. The lastest tagged version is installed (or latest master if there are no tags). You can override this with nimble install nimgame@0.5. Installing nimble with nimble will grab the latest version of the package manager (rather than the one coming with your nim distribution.

lsp

Seems to support most lsp features and works great in vim.
nimble install nimlsp

variables

let vs const

Both let and const will create immutable variables (the value cannot be changed at runtime), but const values must be computable at compile time.

procedures (functions)

proc myProc(name: string): string = "Hello " & name

returns

proc implicit: string =
  "I will be returned"

proc discarded: string =
  discard "I will not be returned"

proc explicit: string =
  return "I will be returned"

proc resultVar2: string =
  result = ""
  result.add("I will be ")
  result.add("returned")

proc errorNoCompile: string =
  result = "I am the result"
  "I will cause an error"