PILCH Hartmut 2015-03-11/10.3

Nachrichteneingänge und öffentliche Gedanken

Heute am Mittwoch der als Kalenderwoche 11 bekannten 10. Woche des Jahres, dem 11. März 2015, treffen hier vielleicht Nachrichten und Anregungen ein, für die diese öffentliche Tagebuchseite zum Thema PILCH Hartmut als erste Anlaufstelle zur Weiterverarbeitung dienen kann.

[ diese Woche ][ gestern ][ heute ][ morgen ]

yusiao_santcasing_siandzy

Morgens regnerisch, mittags sonnig, Temperaturen unter 10.

東日本大震災の四周年かな。

Vierter Jahrestag der ostjapanischen Erdbebenkatastrophe, Merkel noch in Japan?

Perl Template executes conditional definitions of macros but not of blocks

I recently reported about problems with Perl Template macros. Here is a case where macro definitions create no problems but the supposedly more robust block definitions do.

When creating configuration files for various programming languages, this works fine

[% SWITCH OBJLANG -%]
[% CASE 'bash' %][% PROCESS 'objlang_bash_tmpl.txt' %][% SFX = 'sh' %][%# bash -%]
[% CASE 'perl' %][% PROCESS 'objlang_perl_tmpl.txt' %][% SFX = 'pl' %][%# perl -%]
[% CASE 'ruby' %][% PROCESS 'objlang_ruby_tmpl.txt' %][% SFX = 'rb' %][%# ruby -%]
[% CASE 'make' %][% PROCESS 'objlang_make_tmpl.txt' %][% SFX = 'mk' %][%# make -%]
[% CASE 'lisp' %][% PROCESS 'objlang_lisp_tmpl.txt' %][% SFX = 'el' %][%# lisp -%]
[% CASE %][% FILTER stderr %]Unknown Object Language '[% OBJLANG %]'.[% END %][% STOP -%]
[% END %][%# switch_objlang -%]

But when, instead of reading the definitions from external files with PROCESS statements we include the contents of these files, we end up producing Lisp files only.

[% BLOCK getkonst_blok %][% SWITCH val %][% CASE [ 'OK', '1', 't' ] %]t[% CASE ['KO', 'nil', 'f', '0', ''] %]nil[% CASE %]"[% 
val %]"[% END %][% END -%]
[% BLOCK defkonst_blok %](defvar [% var %] [% PROCESS getkonst_blok %][% IF kmt %] "* [% kmt %]"[% END %])[% END -%]
[% BLOCK setkonst_blok %](setq [% var %] [% PROCESS getkonst_blok %])[% IF kmt %][% koment(kmt) %][% END %][% END -%]
[% BLOCK koment_blok %][% IF text %]; [% text %][% END %][% END -%]

This Lisp file is the last in the SWITCH case list and therefore supplants the preceding ones even when we don’t write Lisp files. To avoid this unreasonable behaviour, we have to resort either to external files or to defining macros instead of blocks.

This time I tried to first define blocks and then simple macro versions on their basis:

[% MACRO koment(text) PROCESS koment_blok -%]
[% MACRO setkonst(var,val,kmt) PROCESS setkonst_blok -%]
[% MACRO defkonst(var,val,kmt) PROCESS defkonst_blok -%]

Things went wrong as soon as I moved to this supposedly more elegant syntax in which anonymous blocks are named.

The following minimal example reproduces the behavior. The macro definition is executed and used as would be expected but the block definition is not.

[% IF 1 -%]
[% BLOCK dum_blok %]Block OK
[% END %]
[% MACRO dum_makr BLOCK %]Macro OK
[% END %]
[% ELSE %]
[% BLOCK dum_blok %]Block KO
[% END %]
[% MACRO dum_makr BLOCK %]Macro KO
[% END %]
[% END -%]
[% PROCESS dum_blok %]
[% dum_makr %]

The output of this is as follows:

Block KO
Macro OK

Reinstate Jeremy Clarkson!

The BBC has suspended a journalist who had many grateful listeners.

AfD stimmt Kampf gegen sich selbst zu

Im Kampf gegen Rechts, bei dem insbesondere die AfD im Fadenkreuz steht, wurden in München weitere 378.000 Euro Steuergeld bereitgestellt. Die AfD stimmte dafür.

Fukushima, Jahrestag der Fälscher

Dirk Maxeiner schreibt:

Frische Fachkräfte werden verladen – und es kommen ALLE

Netzplanet schreibt:

Die Dummheit der deutschen Flüchtlingspolitik verbreitet sich in ganz Afrika wie ein Buschfeuer.

Es ist eine europäische Dummheit. Sie wird in Straßburg gemacht und nennt sich “Nichtzurückweisungsprinzip”. Es ist keine Politik sondern “Recht”. Asylunrecht würde ich es nennen. In Afrika gibt es genug dauerbürgerkriegende gescheiterte Staaten und es werden immer mehr. Dafür sorgen Tribalismus, verantwortungsloses Reproduktionsverhalten und weitere tief verankerte menschliche Unzulänglichkeiten. Es gibt keinen Grund, warum menschliche Staaten Erfolg haben müssen, Sündenböcke braucht man zur Erklärung nicht, schon gar nicht europäische Sündenböcke. Auch ohne Wirtschaftsflüchtlinge gäbe es in Afrika mehr als genug echte Asylberechtigte, um Europa zu überrennen, und immer mehr sind dank Fortschritten der Fluchthilfetechnik in der Lage, ihr Asylrecht in Europa wahrzunehmen. Asylmissbrauch ist nicht das Problem. Das Asylrecht IST der Missbrauch. Es war von Anfang an eine fromme Dummheit, und seit 1945 haben sich die wahren Gläubigen im Wetteifer um die edelste Gesinnung immer weiter in die Dummheit hineingesteigert.

netzplanet_fachkraefteverladung
deplate
http://a2e.de/dok/phm_pub150311
© 2006-02-19 Hartmut PILCH