From 6491a358a42fb0edf7bc005287ad83b61d8e4fb5 Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Sun, 14 May 2023 14:18:32 +0300 Subject: [PATCH 1/2] Add unreadable-objects survey --- surveys/unreadable-objects.md | 42 +++++++++++++++++++++++++++++++++++ www-index.scm | 1 + 2 files changed, 43 insertions(+) create mode 100644 surveys/unreadable-objects.md diff --git a/surveys/unreadable-objects.md b/surveys/unreadable-objects.md new file mode 100644 index 0000000..1abb739 --- /dev/null +++ b/surveys/unreadable-objects.md @@ -0,0 +1,42 @@ +# Unreadable objects + +| Implementation | Syntax | Skippable | +|----------------|----------|-----------| +| Chez Scheme | `#<...>` | no | +| Chibi-Scheme | `#<...>` | no | +| Chicken | `#<...>` | no | +| Gambit | `#<...>` | no | +| Gauche | `#<...>` | no | +| Guile | `#<...>` | no | +| Kawa | `#<...>` | no | +| MIT Scheme | `#[...]` | no | +| Mosh | `#<...>` | no | +| Sagittarius | `#<...>` | no | +| STklos | `#[...]` | YES? | +| (Common Lisp) | `#<...>` | no | + +## Conflicts + +Chicken and Gambit support multi-line strings via the following +syntax. (The syntax imitates the Bourne shell, which calls a +multi-line string a "here-document".) + + <`. + +In both cases there is a syntactic ambiguity. Chicken, Gambit, and +Kawa all use `#<` to write unreadable objects. Since valid Scheme +source code cannot contain unreadable objects, there is no read-time +ambiguity for valid code. The ambiguity does make it harder to deal +with invalid input where an unreadable object may be silently +misinterpreted as some type of readable object or rejected with a +confusing error message. diff --git a/www-index.scm b/www-index.scm index d24cefc..92e87be 100644 --- a/www-index.scm +++ b/www-index.scm @@ -89,6 +89,7 @@ "reader-vertical-bar-concatenated-with-number" "square-brackets" "string-symbol-conversion" + "unreadable-objects" "unsigned-imaginary" "upper-case-escape" "vertical-line-symbols") From aa3b8ee178eb9b183c1e44879d953ef0fc7b5cbc Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Sun, 14 May 2023 15:10:24 +0300 Subject: [PATCH 2/2] Update unreadable-objects --- surveys/unreadable-objects.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/surveys/unreadable-objects.md b/surveys/unreadable-objects.md index 1abb739..89a75d0 100644 --- a/surveys/unreadable-objects.md +++ b/surveys/unreadable-objects.md @@ -1,5 +1,8 @@ # Unreadable objects +This is a survey of the lexical syntax that the `write` procedure uses +to write unreadable objects. + | Implementation | Syntax | Skippable | |----------------|----------|-----------| | Chez Scheme | `#<...>` | no | @@ -15,6 +18,10 @@ | STklos | `#[...]` | YES? | | (Common Lisp) | `#<...>` | no | +**Skippable** means that the written stand-in object can be parsed as +an S-expression (using the syntax of that implementation) and +therefore skipped to find more S-expressions in the same stream. + ## Conflicts Chicken and Gambit support multi-line strings via the following @@ -40,3 +47,6 @@ ambiguity for valid code. The ambiguity does make it harder to deal with invalid input where an unreadable object may be silently misinterpreted as some type of readable object or rejected with a confusing error message. + +STklos has a similar syntax `#<` for unreadable data there is no ambiguity.