Zolang v0.1.17 Release Notes

Release Date: 2018-10-15 // about 4 years ago
  • 0.1.17

    ๐Ÿ‘‰ Users can now use the metaprogramming features raw and only


    raw {'Any text here'}

    This will tell the compiler to skip the code generation process for "Any text here" and forward it as is to the compilers output


    only "<flag1>", "<flag2>",... { <code> }

    ๐Ÿ— Using only we can tell the compiler to ignore code for buildSettings not included in a comma separated list of flags

    only "python2.7", "swift" {

    Putting it all Together

    ๐ŸŒฒ Using these two features (raw & only) we could create a facade for logging to the console:

    describe Sys {
      static log return from (txt as text) {
        only "python2.7", "swift" {
          raw {'print(txt)'}
        only "kotlin" {
          raw {'println(txt)'}
    Sys.log("Hello World!")