sigma.Environment.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sigma-state_2.12 Show documentation
Show all versions of sigma-state_2.12 Show documentation
Interpreter of a Sigma-State language
The newest version!
package sigma
/** Describes the current execution environment. */
sealed abstract class Environment {
/** Runtime platform for the current environment. */
def runtimePlatform: RuntimePlatform
/** Returns true when executed on JVM. */
def isJVM: Boolean
/** Returns true when executed on JS. */
def isJS: Boolean
}
object Environment {
/** Current runtime environment. */
implicit val current: Environment = new Environment {
override def isJVM: Boolean = runtimePlatform == RuntimePlatform.JVM
override def isJS: Boolean = runtimePlatform == RuntimePlatform.JS
override def runtimePlatform: RuntimePlatform = sigma.reflection.Platform.runtimePlatform
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy