Thank you both. Enough to fiddle with. The goal is to find the index of the
first occurrence of Box(food: value), if at all. Like `seq.find(value)`
Cheers.
Not entirely sure what exactly you want findInObjSeq to do. Is this supposed to
return you a count? An Index? An instance from the list?
Either way, if you want to get past this entirely without macros you will need
to make use of the `when` keyword instead of "if". And also the fieldpairs
iter
>From your example it seems that you want to count quantity of specified items
>in seq. You can do this easily with `sequtils.countIt`:
import std/sequtils
echo c1.content.countIt(it.food == true) # 3
Run
If you don't need a count and only want to check if item is
How does one find out whether a field in an object in an array exists? The
commented out `echo declared(c1.content[0].thing)` errors.
How do I find whether a value in a field of an object in an array exists using
a proc, or template? The commented out code shows my failure.
type