Skip to content

Playing with macros for creating tuples from a variable number of arguments

License

Notifications You must be signed in to change notification settings

Scalera/macros-handson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macros-handson

Playing around with macros...

Entity macro

This macro allows creating a case class from a variable number of Tuple2[String,_].

E.g.:

import scalera.macros._
import scalera.macros.Entity._

val entities = 
  Entity("MyEntity")(
    "att1" -> 5,
    "att2" -> true)

import entities._

val myEntity = MyEntity(2,false)

assert(myEntity.att1==5)
assert(myEntity.att2==false)

License

Licensed to Scalera blog. Released under Apache License, Version 2.0.

About

Playing with macros for creating tuples from a variable number of arguments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages