@alehander42: implicit conversions can't detect heterogeneous types.

@mratsim: I can have strongly typed heterogeneous lists, but maybe not in nim. 
I already presented my issue and how much heterogeneity I need. I also told you 
that T needs to be a concept.

@andrea: yes, it's a limitation of nim's typesystem. The code you posted is 
nice but still unsafe. You're getting close, we just need a little variance on 
the hcons tail.

@mashingan: yes, I can solve it dynamically - but I also mentioned that I don't 
want to do that.

The HgList/HgCell solution is fine with the right constraints because we can 
limit the possible types at compile-time and also make sure that the extraction 
is always typesafe if we hide the core data structures and provide typesafe 
append operations. The data can be dynamic but the data handlers can't because 
only the lowest module knows what's the of the data. With typesafe extractors 
and optionals the user can get the data easily.

Reply via email to