0

I have a sequence of functions

scala> a.foreach(println)

<function1>
<function1>
<function1>
<function1>
<function1>

It sounds impossible but I wonder if scala provides any way to actually print the definition of these functions at the end of this foreach loop?

Mark
  • 10,754
  • 20
  • 60
  • 81
  • Definition in what? Scala source code? How would that work given that it compiles to bytecode? Anyways, this may be helpful: http://stackoverflow.com/questions/2737285/is-there-a-way-to-obtain-the-bytecode-for-a-class-at-runtime – rethab Dec 05 '16 at 20:20
  • Yes, either some bytecode or some clue as to what the function does (perhaps in the form of an anonymous function) – Mark Dec 05 '16 at 20:42
  • Why do you want that? – Reactormonk Dec 05 '16 at 23:56
  • Good question :) These functions are generated programmatically and I'd like to make sure they are correct. – Mark Dec 07 '16 at 21:15

0 Answers0