All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.scalamacros.paradise.Settings.scala Maven / Gradle / Ivy

The newest version!
package org.scalamacros.paradise

object Settings {
  class Setting[T](get: () => T, set: T => Unit) {
    def value = get()
    def value_=(value: T) = set(value)
  }

  def boolSetting(key: String) = new Setting[Boolean](
    get = () => {
      val svalue = System.getProperty("macroparadise." + key)
      svalue != null
    },
    set = value => {
      val svalue = if (value) "true" else null
      System.setProperty("macroparadise." + key, svalue)
    }
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy