CMM2: Suggestion to replace Peek(ProgMem, of) and Peek(VarTbl, of)


Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 2085
Posted: 12:13pm 18 Oct 2021      

Hi Peter,

I recognise that PEEK(ProgMem, offset) and PEEK(VarTbl, offset) only have very specialised use-cases but even within those I'm not sure these are the optimal functions to have in the language because they force the user to read a byte at a time.

Should you consider replacing them with PEEK(ProgMemAddr) and PEEK(VarTblAddr) ? That way MEMORY COPY and MEMORY SET can be used with these data structures, and also PEEK(SHORT|WORD|INTEGER) ... though the user has to be careful to avoid data alignment errors ...

... or is this deliberate to prevent the use poking into these areas ... in which case why is there a POKE(VarTbl ...) ?

Best wishes,

Tom