Project

General

Profile

Feature #8655

appending PROLOG definitions

Added by Andrei Gaponenko over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Infrastructure
Target version:
Start date:
05/07/2015
Due date:
% Done:

100%

Estimated time:
16.00 h
Spent time:
Scope:
Internal
Experiment:
Mu2e
SSI Package:
fhicl-cpp
Duration:

Description

Hello,

The "last definition wins" rule allows for a straightforward
modification of parameter values in a non-interactive environment by
appending the desired definition to an existing fcl file. This
technique does not work for PROLOG variables: given a file like

#----------------
BEGIN_PROLOG
aFileList : [ "a" ]
END_PROLOG

x.f : @local::aFileList
y.f : @local::aFileList

#----------------

neither pre-pending nor appending to the file of a fragment like

#================
BEGIN_PROLOG
aFileList : [ "b" ]
END_PROLOG
#================

will have the effect of setting x.f and y.f to [ "b" ].

Per our discussion, please change behavior of fhicl to allow an
appended PROLOG to re-define an earlier PROLOG variable as seen by the
non-PROLOG body of the file.

Andrei


Related issues

Related to art - Feature #7231: Request two new fhicl featuresClosed2014-10-28

History

#1 Updated by Christopher Green over 4 years ago

  • Category set to Infrastructure
  • Status changed from New to Feedback
  • Target version set to 1.18.00

Discussion is ongoing on the art-stakeholders list.

#2 Updated by Christopher Green about 4 years ago

  • Status changed from Feedback to Assigned
  • Assignee set to Christopher Green
  • Estimated time set to 16.00 h
  • SSI Package fhicl-cpp added
  • SSI Package deleted ()

#3 Updated by Christopher Green about 4 years ago

  • Status changed from Assigned to Feedback

Per email and other discussions:

The allowed syntax will be as follows:

var [BINDING_MODIFIER]: val
with
BINDING_MODIFIER := @protect_ignore | @protect_error

The default protection status of a binding will be inherited from its containing assignment if there is one, and binding modifiers may only increase the protection (@protect_error > @protect_ignore > <none>) relative to that inherited from above.

Note that there shall be no space between any specified binding modifier and its trailing :.

Does this sound reasonable?

#4 Updated by Christopher Green about 4 years ago

#5 Updated by Andrei Gaponenko about 4 years ago

Yes, that sounds good.

Andrei

#6 Updated by Rob Kutschke about 4 years ago

It looks good to me.

#7 Updated by Christopher Green about 4 years ago

Rob, Andrei:

What should happen in the following scenario:

BEGIN_PROLOG
x @protect_ignore: 7
END_PROLOG
.
.
.
BEGIN_PROLOG
x @protect_ignore: 12
END_PROLOG
or
BEGIN_PROLOG
x : 7
END_PROLOG
.
.
.
BEGIN_PROLOG
x @protect_ignore: 12
END_PROLOG

?

#8 Updated by Andrei Gaponenko about 4 years ago

I suggest to treat each of these cases as an error.
Andrei

#9 Updated by Christopher Green about 4 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 0 to 100

This issue has been resolved with commits fhicl-cpp:810f733, fhicl-cpp:1736c2a and fhicl-cpp:9dbc57e. See release notes for feature details.

#10 Updated by Christopher Green about 4 years ago

  • Status changed from Resolved to Closed
  • Target version changed from 1.18.00 to 1.15.00


Also available in: Atom PDF