Two bugs: serial stream input; lognot documentation string


#1

Ran into a couple of small bugs while having some fun with uLisp:

  1. The following patch against uLisp 4.4a for ARM allows the read function to read a list from a with-serial connection without needing a space before a close paren. Note that I just pattern matched with the other stream input functions, so I’m not sure if this is an appropriate fix.
--- ulisp44aPico.ino.orig	2023-04-01 14:09:56.597838849 -0700
+++ ulisp44aPico.ino	2023-04-01 14:22:28.142608521 -0700
@@ -2048,13 +2048,13 @@
 inline int i2c1read () { return I2Cread(&Wire1); }
 #endif
 #if defined(ULISP_SERIAL3)
-inline int serial3read () { while (!Serial3.available()) testescape(); return Serial3.read(); }
+inline int serial3read () { if (LastChar) { char temp = LastChar; LastChar = 0; return temp; } while (!Serial3.available()) testescape(); return Serial3.read(); }
 #endif
 #if defined(ULISP_SERIAL3) || defined(ULISP_SERIAL2)
-inline int serial2read () { while (!Serial2.available()) testescape(); return Serial2.read(); }
+inline int serial2read () { if (LastChar) { char temp = LastChar; LastChar = 0; return temp; } while (!Serial2.available()) testescape(); return Serial2.read(); }
 #endif
 #if defined(ULISP_SERIAL3) || defined(ULISP_SERIAL2) || defined(ULISP_SERIAL1)
-inline int serial1read () { while (!Serial1.available()) testescape(); return Serial1.read(); }
+inline int serial1read () { if (LastChar) { char temp = LastChar; LastChar = 0; return temp; } while (!Serial1.available()) testescape(); return Serial1.read(); }
 #endif
 #if defined(sdcardsupport)
 File SDpfile, SDgfile;
  1. The documentation string for lognot has gotten intermingled with the one for prin1-to-string:
22911> (? lognot)
(prin1-to-string item [stream])
Prints its argument to a string, and returns the string.
Characters and strings are printed with quotation marks and escape characters,
in a format that will be suitable for read-from-string.

22911> 

Thanks.


#2

Thank you for these - I’ll fix them!


#3

The documentation string (and several others) have been fixed in uLisp Release 4.4b. The other bug will be fixed in a later release.


#4