When using a DCG on a binary file can the position be changed?

Thanks. :slightly_smiling_face:

In the early parts of parsing of a PE file using DCGs was working because the data was laid out sequentially. Latter the data has pointers to null terminated structures (think null terminated strings) which requires either keeping multiple offsets (think the value for seek/4) and jumping forward and backward in the data so lazy list (think phrase_from_file/3) are out. Then to keep track of the different offsets for each DCG is making the code harder to understand for a novice.

One option I did not try but I think would work would be to push the data such as offset onto a stack and when accessing data at a new offset would push a new context so that the DCG works as expected. For those who are comfortable with such the code would make sense but as I want to reserve the option to release the code for public use would rather make it much simpler for the everyday programmer and setting the offset with a seek function/method is common knowledge in parsing binary data so for now will not use DCGs and instead base it on