Skip to content

Instantly share code, notes, and snippets.

@retronym
Created July 19, 2010 18:04
Show Gist options
  • Save retronym/481742 to your computer and use it in GitHub Desktop.
Save retronym/481742 to your computer and use it in GitHub Desktop.
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
Copy link

Hello, how to quit from power mode?

@SethTisue
Copy link

SethTisue commented Feb 18, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment