[librecat-dev] Things I'm missing in the Fix language

Klee, Carsten Carsten.Klee at sbb.spk-berlin.de
Mon May 22 12:07:12 CEST 2017

Hi everyone!

I know the fix language is not a programming language. But there are a few things I'm missing, which could make the fix language more usable and prevent from the costs of the creation of custom fix functions...

I'm missing some kind of integer iteration. In MARC records for instance, we have enumeration and sequences. Therefore a integer iteration could help to do something like

marc_spec(363$8/0, my.sequal)
do iterate(start:1, end:10, method:++, offset:1, var:i)
  if all_match(my.sequal, i)

Another thing I'm missing is some kind of dynamic path manipulation. For instance I have some values within my data, which I want to be a new key:

my.value = 'dc_identifier'

now want:
my.dc_identifier = 'some val'

I'd tried to write a fix for that like:

value_as_key(my.value, 'some val')

But with the emit* functions I found this not trivial. And I ask myself if this functionality could be implemented in the fix language itself. Something like

set_field(my.{{my.value}}, 'some val')

would be great.

And about the documentation of the fix functions: the Cheat Sheet is a central starting point when looking for fix functions. There should be  provided links to the PODs. Not everyone is familiar with the module/namespace/documentation system on CPAN or MetaCPAN. For instance in the cheat sheet I read

count("myarray")       # count number of elements in an array or hash

And this is not very helpful and I have to know, that I have to google for 'catmandu fix count' to finally  get to https://metacpan.org/pod/Catmandu::Fix::count.

Maybe all this is material for a discussion at a Catmandu workshop/meeting. Do you plan to have one in the near future?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20170522/56a3f52f/attachment.html>

More information about the librecat-dev mailing list