alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (package.scala)

This example Scala source code file (package.scala) is included in my "Source Code Warehouse" project. The intent of this project is to help you more easily find Scala source code examples by using tags.

All credit for the original source code belongs to scala-lang.org; I'm just trying to make examples easier to find. (For my Scala work, see my Scala examples and tutorials.)

Scala tags/keywords

context, use

The package.scala Scala example source code

package scala
package reflect

/**
 * <span class="badge badge-red" style="float: right;">EXPERIMENTAL</span>
 *
 *  The base package for Scala macros.
 *
 *  Macros are functions that are called by the compiler during compilation.
 *  Within these functions the programmer has access to compiler APIs.
 *  For example, it is possible to generate, analyze and typecheck code.
 *
 *  See the [[http://docs.scala-lang.org/overviews/macros.html Macros Guide]] on how to get started with Scala macros.
 */
package object macros {
  /** The Scala macros context.
   *
   *  In Scala 2.11, macros that were once the one are split into blackbox and whitebox macros,
   *  with the former being better supported and the latter being more powerful. You can read about
   *  the details of the split and the associated trade-offs in the [[http://docs.scala-lang.org/overviews/macros.html Macros Guide]].
   *
   *  `scala.reflect.macros.Context` follows this tendency and turns into `scala.reflect.macros.blackbox.Context`
   *  and `scala.reflect.macros.whitebox.Context`. The original `Context` is left in place for compatibility reasons,
   *  but it is now deprecated, nudging the users to choose between blackbox and whitebox macros.
   */
  @deprecated("Use blackbox.Context or whitebox.Context instead", "2.11.0")
  type Context = whitebox.Context
}

Other Scala source code examples

Here is a short list of links related to this Scala package.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.