Skip to content

Pattern: Singleton

justinmann edited this page Dec 24, 2017 · 3 revisions

You can create values in the global namespace using the same name as the class, like this:

logger(
	info(s:'string)
	error(s:'string)
) { this }

logger : logger()

logger.info("hi")

Clone this wiki locally