Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using Power Mode in the Scala REPL to find the parameter names of a method
scala> :power
** Power User mode enabled - BEEP BOOP **
** scala.tools.nsc._ has been imported **
** New vals! Try repl, global, power **
** New cmds! :help to discover them **
** New defs! Type power.<tab> to reveal **
scala> val s = repl.stringToCompilerType("scala.Some")
s: repl.compiler.Type = object Some
scala> val applyMethod = s.members.find(_.name.toString == "apply").get
applyMethod: repl.compiler.Symbol = method apply
scala> val param00Name = apply.paramss(0)(0).name
param00Name: repl.compiler.Name = x
@taintech

This comment has been minimized.

Copy link

taintech commented Jul 28, 2011

Hello, how to quit from power mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.