Positron version 0.0.8 released

2013-12-11

The next version of Positron, version 0.0.8, has been released on CPAN.

Just a minor change: the "?" sigil in hashes under Positron::DataTemplate no longer signifies a "switch" statement, but a "conditional key". I was asked for an example for Positron::DataTemplate, and I came up with this:

{
   "title": "{$titel}",
   "link": {
     "< 1": ["?is_external", { "type": "external" }, {}],
     "url": "{$href}"
   }
}

Note the complicated way in which the key-value-pair "type": "external" under the "link" hash (or map, or object) is present or absent based on the condition is_external.

Now there's a simpler syntax for this common case:

{
   "title": "{$titel}",
   "link": {
     "?is_external" => { "type": "external" },
     "url": "{$href}"
   }
}

This does mean that the "?" sigil can no longer signify a switch statement. I'm letting the "|" sigil do this now; this is closer to Positron::Template anyway. Apologies to all the users who will have to adapt their code (just kidding: the actual number of Positron::DataTemplate users is almost certainly 0 at this point :-P )

Anyway, that's why it's still alpha.