boomlinde 6 days ago

1. If you mean @fieldParentPtr, the first argument is a compile time-known name of a field, the second argument is a pointer to a field of that name in the parent type, which is inferred from the left hand side of the assignment

2. Then you're screwed. In Zig, using @fieldParentPtr on a field that doesn't have the given parent is unchecked illegal behavior, meaning that there are no checks that can catch it at compile time. This change basically guarantees that there will be a pretty serious foot gun every time you iterate over the items of a standard library list.

2
throwawaymaths 5 days ago

Is 2 really an issue? Just how often are you going to have multiple Node types going on in your codebase?

roetlich 6 days ago

Thank you, that answers all my questions.