EDIT 3: Trying the short symbol trick like this…
char myname[] = “short”;
object* propname = intern(lispstring(myname)->name);
… does not crash uLisp and results in a “visually correct” dotted pair (short . "text"), but the dotted pair still isn’t found by (assoc 'short mylist-with-pair-in-it). Looks like I’m partially stuck - not totally, since the whole thing now works with longer symbol names.
EDIT 2: I’ve tracked it down. First, internlong(“message”) needs to be replaced with a proper char[] initilized with the string:
char myname[] = “message”;
object* propname = internlong(myname);
When doing it this way, uLisp does not crash trying to access the symbol. Second, quite logical, “internlong” can only be used for symbol names that qualify as “long” - if I use “internlong” on shorter words (which I did), the equality check of assoc fails. I’ll try to use just “intern” with those and will report back.
EDIT: Rejoycing below was too early - something must be missing, because assoc fails to identify the dotted pair in uLisp, and when I try to access the symbol using car, uLisp crashes… sorry to bother you again.
That worked, thanks so much! I just did the following:
object* mysym = internlong(“message”);
The resulting object is correctly consed as a symbol into the list I return to uLisp.