Re: [Chicken-users] Fwd: Peeking N characters in string ports

2019-01-11 Thread Vasilij Schneidermann
Hello David, I've run into a similar problem when trying to detect magic bytes for unknown image formats. Most allowed figuring out the format by checking four bytes, one after three bytes. I've solved this problem by rethinking it a bit, first read in three bytes and compare, if it's not the

Re: [Chicken-users] Fwd: Peeking N characters in string ports

2019-01-11 Thread Jörg F . Wittenberger
Hi David, On Jan 11 2019, David Ireland wrote: Hi there, I'm reading from a (string) port and have a need to peek 2 characters inside without actually reading off the port (read-char). I believe procedures such as unread-char seen in other Schemes would solve my problem however, this isn't

[Chicken-users] Fwd: Peeking N characters in string ports

2019-01-11 Thread David Ireland
Hi there, I'm reading from a (string) port and have a need to peek 2 characters inside without actually reading off the port (read-char). I believe procedures such as unread-char seen in other Schemes would solve my problem however, this isn't available in Chicken it seems. Would anyone have