Positron version 0.0.4 released


The next version of Positron, version 0.0.4, has been released on CPAN. This version adds the special expression variable "_", which I talked about earlier. This expression will allow at least two things:

First, one can now loop over a list of arbitrary things, not just hashes. For example, this becomes possible in Positron::DataTemplate:

// 'smallwords' is ['the', 'at', 'but', 'it']

['@smallwords', '$_', 'and']

-> ['the', 'and', 'at', 'and', 'but', 'and', 'it', 'and']

which is not a very good example, but the will is there.

The second possibility will come when the assignment construct is implemented. Assigning "_" to another variable wrapper will cause the entire environment to be stuffed under wrapper.<?>. Assigning a (usually hash) variable to "_", on the other hand, "unstuffs" the contents into the top level. Temporarily, at least.

More to follow.

Additionally, this version adds a wrapping construct, ":". It works about as the linked post describes.

Next up for Positron::DataTemplate: assignment, and the literal "~" construct. Then nothing's left but documentation, hardening and bug fixes.

Next up for Positron: the Positron::Template DOM-level templating engine, a.k.a. "the beef"!