Importing Common Lisp Files in Medley with TextModules

6 views
Skip to first unread message

Paolo Amoroso

unread,
Feb 18, 2024, 7:01:30 AMFeb 18
to Medley Interlisp core
I ran TextModules to import into Medley some Common Lisp files from Peter Seibel's "Practical Common Lisp", so I posted some notes on how to do it.

I used TextModules for just two files but I'm impressed at how smoothly things went. The tool is easy to understand and worked with no errors at the first run, even if one of the files contains unsupported LOOP code. What it's not clear to me is why the imported code relies on the special readtable LISP-FILE, thus requiring TextModules to be loaded whenever the imported code is used.

--

Larry Masinter

unread,
Feb 19, 2024, 4:41:56 PMFeb 19
to Paolo Amoroso, Medley Interlisp core
The special readtable in TEXTMODULES is used to preserve comments in soource code. In the Common Lisp readtables, the (unquoted) semicolon ; is treated as "skip all content until the next end-of-line.
THe LISP-FILE readtable is modified to recognize the number of semi-colons ";" ";;" ";;;" and turn the following text into an Interlisp-style comment

(IL: *;;; "This is a comment")

Which the definer (DEFUN, DEFMACRO etc) will remove before turning the result into executable code.

Interlisp doesn't allow comments in arbitrary locations, which often means comments aren't always next to the place where it would apply.

, but with TextModules you get comments anywhere.


--
You received this message because you are subscribed to the Google Groups "Medley Interlisp core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lispcore+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lispcore/CAGi1hzsPBTqfdf462VFOPLcA9Ub-gZiJGkcK%2BA%2BwR7Sq%2B4pwrw%40mail.gmail.com.


--

Paolo Amoroso

unread,
Feb 20, 2024, 3:15:32 AMFeb 20
to Larry Masinter, Medley Interlisp core
On Mon, Feb 19, 2024 at 10:41 PM Larry Masinter <L...@acm.org> wrote:
The special readtable in TEXTMODULES is used to preserve comments in soource code. In the Common Lisp readtables, the (unquoted) semicolon ; is treated as "skip all content until the

Thanks, I linked to your reply from my post.
Reply all
Reply to author
Forward
0 new messages