I'll show you the example in question...

Here we have the **printable** module, which comes with a `$` overload which is 
supposed to take Value objects and return them stringified.

As you can see there are different _kinds_ of Value objects, so the 
stringification process varies accordingly.

Let's take 2 concrete examples:

**Logical** values are actually an enum and are defined here: 
<https://github.com/arturo-lang/arturo/blob/symbol-values-as-a-distinct-module/src/vm/values/custom/vlogical.nim#L47-L50>
 (with their own `$` overload)

And handled here: 
<https://github.com/arturo-lang/arturo/blob/symbol-values-as-a-distinct-module/src/vm/values/printable.nim#L40>

It works fine.

**Symbol** values are _also_ an enum and are defined here: _Logical*_ values 
are actually an enum and are defined here: 
<https://github.com/arturo-lang/arturo/blob/symbol-values-as-a-distinct-module/src/vm/values/custom/vsymbol.nim#L114-L207>
 (again with their own `$` overload)

And handled here: 
<https://github.com/arturo-lang/arturo/blob/symbol-values-as-a-distinct-module/src/vm/values/printable.nim#L74-L76>

Suprisingly, this does _not_ work.

If you're wondering where Value's are defined, here it is as well: 
<https://github.com/arturo-lang/arturo/blob/symbol-values-as-a-distinct-module/src/vm/values/types.nim#L130-L225>

Still, to me this looks totally baffling. The two types are defined in an 
identical way, with similar overloads, used in pretty much the same way. One 
works, the other doesn't.

Ideas?

Reply via email to