Skip to content

Display of multiple return values #657

@fosskers

Description

@fosskers

Hi, thanks again for Sly.

I'm trying to fix a display bug in my sly-overlay contrib library. Evaluating (values 1 2) via the normal (sly-eval-defun) prints => 1, 2 in the echo area, but its counterpart sly-overlay-eval-defun is showing the following:

overlay

and I'm trying to figure out why.

sly-eval-defun eventually arrives at sly-eval-with-transcript with a form arg of:

(slynk:interactive-eval (values 1 2)

Immediately printing the value in the :ok branch of sly-rex, we see:

1, 2

Now, sly-overlay-eval-defun (being blocking) takes a different execution path and arrives at sly-eval with a sexp arg of:

(slynk:pprint-eval (values 1 2))

Immediately printing the value in the :ok branch of sly-rex, we see:

12

The two slynk calls seems to go here and here. The latter calls slynk-pprint-values, and my guess is that this branch and the call to terpri somehow aren't behaving as expected. At the very least, no newline seems to be printed into the string-stream.

Suggestions:

  • An optional sep arg could be added to slynk-pprint-values so that pprint-eval could specify , as a separator instead to match interactive-eval.

Thoughts? Thanks again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions