Alec Larson
Alec Larson
Oh wait, I went full noob there. Just need to remove the `not nil` in my own proc 😅
Interestingly, I get a `cannot prove "x" is not nil` error when I remove `not nil` from my proc... ```nim proc hasDocument*(docRef: OpleRef) {.query.} = let col = query.getCollection(docRef.collection) let...
Okay, here's my workaround: ```nim proc getCollection*(query: OpleQuery, name: string): Collection not nil = var col = query.database.openCollectionOrNil name if col == nil: raise newException(Defect, "bad ref") # HACK: this...
Reopening, as it would be nice if `with` did not require proof of `not nil` for the snapshot and collection arguments.
Here I found that someone already implemented it for you: https://github.com/gunderson/colors.js/commit/2b97d28987a3e0bfe7f4e54703b27ff96ff8fa74 You should add it to this repo. :smile:
> preserving the simplicity of there being only one way to declare variables is our top priority Backwards compatibility is probably the top priority, since we don't want to fracture...
Furthermore, it seems a new consensus has been established in regard to "block scoping by default" being too drastic of a breaking change, which has a strong possibility of fracturing...
I agree with @zeekay. Block scoping by default is the way forward, and the upgrade path looks smooth. The JS community is evidence that the majority prefer block scoping. Anyone...
Should all methods in object literals transpile to `foo() {}` with this change? Or only if `super` is used?
I'm not familiar with the architecture, and have no time to learn it currently. 😢