Language Change Specification for Environment API

LCS Number: LCS-2016-006g
Version: 3
Date: 07-Mar-2017
Status: Voting
Author: Thomas Preusser
Email: Main.ThomasPreusser
Source Doc:  
Summary: Allow access to system environment variables (explorable).

Voting Results: Cast your votes here

Yes:

  1. Thomas Preusser - 2017-03-06 - ver 3
  2. Jim Lewis- 2017-03-06 - ver 2
  3. Patrick Lehmann - 2017-03-14 - ver 3 see my comment

No:

Abstain:

  1. Martin Zabel - 2017-03-07 - ver 3 - I prefer separate functions for environment variables and conditional analysis identifiers.
  2. Rob Gaddi - 2017-03-21 - ver 3 - I think it's technically correct, but can't see a use case in VHDL for querying the entire environment blindly.

Style Notes

Changes are shown in red font.
Deletions are crossed out.
Editing or inline reviewing notes are shown in green font.
Blue text will only be introduced if LCS061, i.e. conditional analysis, is approved.

Reviewing Notes

This is a proposal extending LCS006e. It provides access to the complete sets of environment variables and conditional analysis identifiers through arrays of variable definition vectors.

Details of Language Change

16.5 Standard environment package

16.5.1 General [NEW headline level]

Package ENV contains declarations that provide a VHDL interface to the host environment.

package ENV is
  procedure STOP (STATUS: INTEGER);
  procedure STOP;
  procedure FINISH (STATUS: INTEGER);
  procedure FINISH;
 
  function RESOLUTION_LIMIT return DELAY_LENGTH;

  [... LCS-2016-011 ...]
  [... LCS-2016-006c ...]
  [... LCS-2016-006e ...]

  type VARIABLE_DEFINITION is record
    name  : LINE;
    value : LINE;
  end record;
  -- The predefined operations for this type are as follows:
  -- function "=" (anonymous, anonymous: VARIABLE_DEFINITION) return BOOLEAN;
  -- function "/=" (anonymous, anonymous: VARIABLE_DEFINITION) return BOOLEAN;

  type VARIABLE_DEFINITION_VECTOR is array(NATURAL range<>) of VARIABLE_DEFINITION;
  -- The predefined operations for this type are as follows:
  -- function "="(anonymous, anonymous: VARIABLE_DEFINITION_VECTOR) return BOOLEAN;
  -- function "/="(anonymous, anonymous: VARIABLE_DEFINITION_VECTOR) return BOOLEAN;
  -- function "&"(anonymous, anonymous: VARIABLE_DEFINITION_VECTOR) return VARIABLE_DEFINITION_VECTOR;
  -- function "&"(anonymous: VARIABLE_DEFINITION_VECTOR; anonymous: VARIABLE_DEFINITION) return VARIABLE_DEFINITION_VECTOR;
  -- function "&"(anonymous: VARIABLE_DEFINITION; anonymous: VARIABLE_DEFINITION_VECTOR) return VARIABLE_DEFINITION_VECTOR;
  -- function "&"(anonymous, anonymous: VARIABLE_DEFINITION) return VARIABLE_DEFINITION_VECTOR;

  type VARIABLE_DEFINITIONS is access VARIABLE_DEFINITION_VECTOR;
  -- The predefined operations for this type are as follows:
  -- function "=" (anonymous, anonymous: VARIABLE_DEFINITIONS) return BOOLEAN;
  -- function "/=" (anonymous, anonymous: VARIABLE_DEFINITIONS) return BOOLEAN;
  -- procedure DEALLOCATE (P: inout VARIABLE_DEFINITIONS);

  function GETALLENV return VARIABLE_DEFINITIONS;

  [... LCS-2016-006f ...]

end package ENV;

16.5.5 System Environment API [NEW]

(This paragraph is to go between the paragraphs possibly added by LCS006e and LCS006f as part of this same new section.)

The function GETALLENV returns an access value to an array of variable definition records. Each of these records contains the name and the value of a defined environment variable. The conditional analysis identifiers (24.2) are part of this environment and hide possibly inherited environment variables of identical names.The returned array is a complete list of all defined environment variables completed and possibly shadowed by all conditional analysis identifiers including standard, tool-defined and user-specified identifiers.

Comments

For the sentence before the package declaration:

  • This sentence already exists and can't be added by either of the proposed LCS 006e..g.
  • If this sentence is going to be changed, then indicate this by using red cross out text.
  • The proposed sentence breaks the meaning of the existing sentence. Sub programs like STOP or RESOLUTION_LIMIT are not related to environment variables.
  • The LRM contains doesn't reference the operating system as "OS". The correct term is "host environment".
  • Reference to other sections are placed in parenthesis instead of square brackets. Square brackets are used for references to bibliographical items in annex J.

The all three new types miss the list of implicitly pre-defined operators for any type, record types, array types and access types.

The syntax of the function definition is no valid VHDL code.

Why is this obscure solution less hacky then my proposed simple solution in LCS 006d?

-- Patrick Lehmann - 2017-03-06

@Patrick: Thanks for your hints. I adopted all your proposed edits.

PL: Why is this obscure solution less hacky then my proposed simple solution in LCS 006d?

Maybe, you can elaborate on the "obscure". Anyhow, if you just compare the number of functions, procedures and types as well as the descriptive text between LCS 006d and LCS 006(e,f,g) combined, you should be puzzled already. Some of this is due to a great deal of alternatives for the same things. For instance: Why does LCS 006d have a procedure ENV_GETVARIABLE if the function ENV_GETVARIABLE directly below does the same with the additional benefit of being usable within expressions? This is the opposite of orthogonality and creates confusion and maintenance hastles.

This concrete LCS 006g addresses a request by Jim to have the environment explorable without a secondary value lookup. LCS 006d does not achieve this.

-- Thomas Preusser - 2017-03-07

I suggest to rename the environment related functions to ENV_*, this aligns with the FILE_* and DIR_* subprograms.

-- Patrick Lehmann - 2017-03-14

Please, just bring this up in the next meeting to pick up the general feeling about it. There are good reasons to establish a naming scheme as you suggest. There are also good reasons to stick with traditional names such as GETENV. Both choices are absolutely valid, and I am ready to follow a broadly and clearly expressed group decision on this matter. I would hope though that every other voter would see it similarly so that we can avoid losing votes again on such a side issue.

-- Thomas Preusser - 2017-03-16

Edit | Attach | Print version | History: r16 | r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2017-04-02 - 15:46:39 - TWikiGuest
 
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback