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

REPL: support for package definition #5299

Closed
scabug opened this issue Dec 12, 2011 · 5 comments
Closed

REPL: support for package definition #5299

scabug opened this issue Dec 12, 2011 · 5 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Dec 12, 2011

Would be handy to define packages in the REPL to quickly test semantics depending on packages like access modifiers. Now all you can do is create a file and test it with the compiler.

scala> package a {
:1: error: illegal start of definition
package a {
^

scala> package a
:1: error: illegal start of definition
package a
^

@scabug
Copy link
Author

@scabug scabug commented Dec 12, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5299?orig=1
Reporter: DaveScala (davescala)
Affected Versions: 2.9.0-1, 2.9.1, 2.9.2

@scabug
Copy link
Author

@scabug scabug commented Dec 12, 2011

DaveScala (davescala) said:
and :paste mode doesn't support it either

@scabug
Copy link
Author

@scabug scabug commented Jul 10, 2013

@adriaanm said:
Unassigning as milestone deadline was reached.

@scabug
Copy link
Author

@scabug scabug commented Aug 27, 2013

@som-snytt said:
You can use raw paste for this use case. That's paste fresh from the can.

scala> :paste -raw
// Entering paste mode (ctrl-D to finish)

package base {
  class Y { val context = "package base" }
}

// Exiting paste mode, now interpreting.


scala> new base.Y().context
res0: String = package base

scala/scala#2725

@scabug
Copy link
Author

@scabug scabug commented Aug 29, 2013

@retronym said:
Closing this as :paste -raw is sufficient.

@scabug scabug closed this Aug 29, 2013
@scabug scabug added this to the 2.11.0-M7 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.