Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced *argument-stream*. #378

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

informatimago
Copy link

@informatimago informatimago commented Apr 6, 2017

Introduced the *argument-stream* variable, bound while evaluating
expressions from slime, to the string-stream where the expression is
read from. This allows the expression to further read from this
stream, to take additional arguments.

EXAMPLE:  Type in *slime-repl*:
              (* 2 (read swank:*argument-stream*))  21  RET
          --> 42

More typical example, using a symbol macro:

cl-user> (defun command-test ()
           (let ((token (read swank:*argument-stream*)))
             (print (list token token)))
           (values))
command-test
cl-user> (define-symbol-macro cmdt (command-test))
cmdt
cl-user> (command-test) 42

(42 42) 
; No value
cl-user> cmdt 42

(42 42) 
; No value
cl-user>

This variable is bound while evaluating expressions from slime,
to the string-stream where the expression is read from.
This allows the expression to further read from this stream,
to take additional arguments.
@informatimago
Copy link
Author

Both changes can be accepted: symbols were added from different patches.

@luismbo
Copy link
Member

luismbo commented May 18, 2021

This seems pretty niche, which is both a pro and a con. :-D *argument-stream* seems like a weird name, that only makes sense for this specific use-case. How about *eval-region-stream* instead?

@informatimago
Copy link
Author

Whatever the name. The functionality is useful.

@stassats
Copy link
Member

I don't like additional code burden for marginally useful features that few people will know about and even fewer will use it.

@informatimago
Copy link
Author

I don't like additional code burden for marginally useful features that few people will know about and even fewer will use it.

What code burden? This is simply making a lexical variable global dynamic, and exporting the symbol!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants