From f93437d8d54e26c64a88e4136e38f6a796d7fd8c Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Fri, 26 Dec 2025 06:34:32 +0100 Subject: Rename notes to add dates and fix index. --- notes/unread.md | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 notes/unread.md (limited to 'notes/unread.md') diff --git a/notes/unread.md b/notes/unread.md deleted file mode 100644 index 31b2f91..0000000 --- a/notes/unread.md +++ /dev/null @@ -1,36 +0,0 @@ -# Must ports support seeking? - -With traditional s-expressions, it's not always possible to stop -reading bytes as soon as the end of the current datum is reached, -because some data don't have a terminating character. Consider a -sequence of s-expressions such as: - - foo(bar) - -After reading the second 'o', the parser has no way of knowing that -the symbol has ended. It must read another byte. - -If the underlying input stream doesn't support "unreading" or seeking -back, this is troublesome: The opening parenthesis is consumed by the -first call to the parser, and then discarded, since it's not part of -the symbol it's reading. The second call to the parser cannot know -that the "read head" is already within a list. - -I assume that traditional lisps work around this issue by requiring -all streams (ports) to have seeking or unreading functionality, which -isn't too bad. Assuming you only need to look ahead by one character, -any port without this feature can be wrapped in a port that adds it -via a simple one-character buffer. If more than one character of -look-ahead is needed, a small circular buffer could be used. - -Thankfully, Zisp s-expressions are all self-terminating. This is -because a datum followed immediately by another datum, without any -blanks in between, is a "joined datum" expression. Any number of -additional data can be joined like this, yielding a more and more -deeply nested compound datum. Only a blank or EOF can end this, -meaning that disjoint data within a stream are necessarily delimited -by blanks. - - - -*** WIP *** -- cgit v1.2.3