From luxhalitus@luxhalitus@null.invalid to comp.lang.lisp on Wed Nov 5 10:18:44 2025
From Newsgroup: comp.lang.lisp
I'm currently prototyping a system of multiple interconnected string
filters and am wondering what the best practices are regarding the
Common Lisp streams API.
If i had a filter function like:
| (defun number-lines (in out)
| (handler-case
| (loop with line = ""
| and number = 1
| do (setf line (read-line in))
| (format out "~D: ~A" number line)
| (incf number))
| (end-of-file (e))))
how would i go about chaining two calls together?
A macro that takes advantage of the string stream types immediately
comes to mind:
You could also write wrappers around C pipe(2) or mkfifo. None of these
seem like such a good fit for Common Lisp streams though, considering
their implementation should already come with some kind of buffering
built in. Allegro CL exposes a make-pipe-streams and a make-function-input-stream function, but no such luck in SBCL it seems.
Any quicklisp packages featuring this exact functionality or
alternatives i'm missing?
--
( (
--- Synchronet 3.21a-Linux NewsLink 1.2
Who's Online
Recent Visitors
Widgit
Sun Jan 11 18:29:52 2026
from
New Zealand
via
Telnet
Geek2
Sun Jan 11 14:07:03 2026
from
Euclid, Oh
via
Telnet
Geek2
Sun Jan 11 11:15:24 2026
from
Euclid, Oh
via
Telnet
Crackerchest
Sun Jan 11 08:12:39 2026
from
Usa
via
Telnet