From dd3d8f9d768479df36e51d402adf55afad1aff07 Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Mon, 10 Feb 2025 20:20:26 +0100 Subject: update --- html/notes/symbols.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 html/notes/symbols.md (limited to 'html/notes/symbols.md') diff --git a/html/notes/symbols.md b/html/notes/symbols.md new file mode 100644 index 0000000..8aa666f --- /dev/null +++ b/html/notes/symbols.md @@ -0,0 +1,19 @@ +# Symbols are strings are symbols + +In Scheme, symbols are literally just interned and immutable strings. +They can contain any character a string can, constructed either via +`string->symbol` or the modern `|foo bar baz|' syntax for quoted +symbols. Why not just embrace the fact that they are strings? + +Scheme strings are mutable, but they are a terrible choice for text +manipulation, because they are constant-length. They are literally +just vectors of characters. If you wanted a vector of characters, +well, use a vector of characters! + +Zisp won't differentiate between symbols and strings. All strings +will be immutable, string constants will be automatically interned, +and bare symbols will just be reader syntax for a string constant. + +Instead of `string->symbol` we will have `string-intern` which +basically does the same thing. Dynamically generated strings that +aren't passed to this function will be uninterned. -- cgit v1.2.3