The <mapped-file> word returns an instance of mapped-file, which doesn't directly support the sequence protocol. Instead, it needs to be wrapped in a specialized array of the appropriate C type:
The appropriate specialized array type must first be generated with SPECIALIZED-ARRAY:.
Data can also be read and written from the mapped-file by applying low-level alien words to the address slot. This approach is not recommended, though, since in most cases the compiler will generate efficient code for specialized array usage. See Reading and writing memory directly for a description of low-level memory access primitives.