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

[SR-8793] Access to file data and functions in REPL #4487

Open
swift-ci opened this issue Sep 18, 2018 · 3 comments
Open

[SR-8793] Access to file data and functions in REPL #4487

swift-ci opened this issue Sep 18, 2018 · 3 comments

Comments

@swift-ci
Copy link

Previous ID SR-8793
Radar rdar://problem/42831983
Original Reporter jkleiser (JIRA User)
Type New Feature
Additional Detail from JIRA
Votes 0
Component/s Compiler, LLDB for Swift
Labels New Feature, REPL
Assignee None
Priority Medium

md5: b158931f122cf4b19148d1be6afab6e4

Issue Description:

It would be great if it was possible to run the `swift` binary with an option, e.g. `-i` for "interactive", that would give access in the REPL to (public) data and functions from the file that was just executed. Today, when doing `swift myscript.swift` from the command line, one is returned to the shell as soon as the script file has been executed. What I ask for, is a way to remain in the REPL and to be able to experiment further with the data and functions that the script provided.

@belkadan
Copy link

Tagging as LLDB since I think we'd implement this by having the existing REPL run a script rather than by having the existing JIT drop you into the REPL. cc jingham@apple.com (JIRA User)

@swift-ci
Copy link
Author

Comment by Jim Ingham (JIRA)

We also had a request for individual commands, something like:

> swift -i -c "import Foundation"
 

Both approaches would be useful, and neither would be hard to implement in lldb.

@belkadan
Copy link

We may want that to also match the syntax for SR-5860, even if the implementation is different.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants