website/content/blog/2024-04-13-sly-repl-io-issues.md

47 lines
1.1 KiB
Markdown

+++
title = "Issue with SBCL console output in Sly"
date = 2024-04-13
[taxonomies]
tags = ["programming"]
categories = ["lisp"]
+++
# Inconsistent output in REPL
When doing the examples in the _Practical Common Lisp_ book I had confusing output in the repl when prompting the user for CDs using SBCL.
```
; Dedicated output stream setup (port 46185)
; Redirecting all output to this MREPL
; SLY 1.0.43 (#<MREPL mrepl-1-1>)
CL-USER> (prompt-for-cd)
Title: Unplugged
Eric Clapton
8
y
```
Apparently a similar issue was first found on MacOSX and later confirmed on Arch.
The suggestion was given to disable passing the output via a socket to have higher performance that via the protocol by adding
```
(setf slynk:*use-dedicated-output-stream* nil)
```
Since I rather have something working that it being high performant not-working I followed the suggestion which fixed the issue:
```
CL-USER> (prompt-for-cd)
Title: Bar
Artist: Foo Fighters
Rating: 8
Ripped: y
y (y or n) y
(:TITLE "Bar " :ARTIST "Foo Fighters" :RATING 8 :RIPPED T)
CL-USER>
```
so I can continue with the chapter.