- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
de-sugaring
Sun, 2009-03-15, 07:22
Sir and Dam Scalahads,
Is there a way to get the scala REPL to de-sugar forms? i'm looking for a way to see the 1-step and complete expansion of certain forms the way one used to be able to get with macroexpand and macroexpand1 in Common Lisp systems.
Best wishes,
--greg
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
806 55th St NE
Seattle, WA 98105
+1 206.650.3740
http://biosimilarity.blogspot.com
Is there a way to get the scala REPL to de-sugar forms? i'm looking for a way to see the 1-step and complete expansion of certain forms the way one used to be able to get with macroexpand and macroexpand1 in Common Lisp systems.
Best wishes,
--greg
--
L.G. Meredith
Managing Partner
Biosimilarity LLC
806 55th St NE
Seattle, WA 98105
+1 206.650.3740
http://biosimilarity.blogspot.com
Sun, 2009-03-15, 10:47
#2
Re: de-sugaring
The -print compiler option also shows you everything desugared.
--j
On Sun, Mar 15, 2009 at 12:52 AM, Rich Dougherty <rich@rd.gen.nz> wrote:
--j
On Sun, Mar 15, 2009 at 12:52 AM, Rich Dougherty <rich@rd.gen.nz> wrote:
Hi Greg
When compiling you can supply a -Xprint:phase argument to the compiler to output the program after a certain compiler phase has completed. You can also supply this argument to the interpreter (which just uses the compiler behind the scenes).
I'm not sure the phase that you're after, but you could use -Xshow-phases to get a list and then experiment.
Rich
On Sun, Mar 15, 2009 at 6:52 PM, Meredith Gregory <lgreg.meredith@gmail.com> wrote:
Sir and Dam Scalahads,
Is there a way to get the scala REPL to de-sugar forms? i'm looking for a way to see the 1-step and complete expansion of certain forms the way one used to be able to get with macroexpand and macroexpand1 in Common Lisp systems.
Best wishes,
--greg
--
http://blog.richdougherty.com/
When compiling you can supply a -Xprint:phase argument to the compiler to output the program after a certain compiler phase has completed. You can also supply this argument to the interpreter (which just uses the compiler behind the scenes).
I'm not sure the phase that you're after, but you could use -Xshow-phases to get a list and then experiment.
Rich
On Sun, Mar 15, 2009 at 6:52 PM, Meredith Gregory <lgreg.meredith@gmail.com> wrote:
--
http://blog.richdougherty.com/