Vindaar / ggplotnim

A port of ggplot2 for Nim
https://vindaar.github.io/ggplotnim
MIT License
177 stars 15 forks source link

fix for https://github.com/nim-lang/Nim/pull/18050 scope based symbol resolution #125

Closed timotheecour closed 3 years ago

timotheecour commented 3 years ago

unblocks https://github.com/nim-lang/Nim/pull/18050

Vindaar commented 3 years ago

Ah, thanks a lot. This is a left over from refactoring out some parts. Surprising that the code works in the first place though.

At the same time, this isn't an implicit (obv. not explicit) generic proc. Does the static argument have the same effect? I suppose it's similar as it also means there will be different instantiated procs.

timotheecour commented 3 years ago

Surprising that the code works in the first place though.

it won't after https://github.com/nim-lang/Nim/pull/18050

this isn't an implicit (obv. not explicit) generic proc.

it's a generic proc because of the static param, eg:

proc fn(a: int, b: static bool = true) =
  static: echo ("instantiating fn", b)
fn(1)
fn(2, true)
fn(3, false)

prints: ("instantiating fn", true) ("instantiating fn", false)