Language Change Specification for Empty records syntax regularization
Voting Results: Cast your votes here
Yes:
- Ryan Hinton - 2016-12-22 - Version 2
- Thomas Preusser - 2016-12-22 - Version 2
- Farrell Ostler - 2016-12-22 - Version 1
- Brent Hayhoe - 2016-12-23 - Version 1
- Jakko Verhallen - 2016-12-29 - Version 1
- Martin Zabel - 2017-02-17 - Version 2
- Rob Gaddi - 2017-01-26 - Version 1
- Jim Lewis- 2017-02-06 - Version 1
- Patrick Lehmann - 2017-02-16 - Version 2
No:
-
Abstain:
- Kevin Jennings - 2016-12-23 - Version 1...don't think I'll make use of this, but not really opposed if it helps someone else
- Lieven Lemiengre - 2017-01-27
- Brent Hayhoe - 2017-02-16 Version 2 - Abstain due to lack of personal time for review.
- Martin Thompson- 2017-02-17 Version 2 - what KevinJ said
Details of Language Change
Changes are shown in
red font. Deleted text is
crossed out. Editing comments are in
green.
LRM 5.3.3 Record types
Modify BNF after first full paragraph, middle of page 51 (pdf 65).
record_type_definition ::=
record
element_declaration
{ element_declaration }
end record [ record_type_simple_name ]
(The identical change should be made in the syntax summary in Annex C.)
LRM 9.3.5 Qualified expressions
A qualified expression is a basic operation (see 5.1) that is used to explicitly state the type, and possibly the subtype, of an operand that is an expression or an aggregate.
qualified_expression ::=
type_mark ' ( expression )
| type_mark ' aggregate
| type_mark ' ( )
For qualified expressions with an operand, Tthe operand shall have the same type as the base type of the type mark. The value of
such a qualified expression is the value of the operand. The evaluation of
such a qualified expression evaluates the operand and converts it to the subtype denoted by the type mark.
A qualified expression without an operand is used to express a literal for a composite type or subtype with no elements. The value of such a qualified expression is an empty value of the type or subtype denoted by the type mark.
--
Ryan Hinton - 2016-12-22
Comments
Suave uses "type foo is null record" to define empty records. How does a map to an empty record look like? Are empty record compatible?
--
Patrick Lehmann - 2016-12-31
PL: Suave uses type foo is null record to define empty records.
MZ: Requiring null record does not work well with conditional compilation. The record might get empty based on conditions.
--
Martin Zabel - 2017-01-09
An alternative for null record is:
type MyRecord is record
null;
end record;
I changed my vote to NO, because I think an empty initialization should be addressed by this proposal too.
type MyRecord is record
`if DEBUG = "TRUE" then
debug1 : std_logic;
`end if
end record;
entity E1 is
port (P : MyRecord);
end entity;
entity E2 is
end entity;
architecture A2 of E2 is
begin
inst : entity work.E1
port map (P => (
`if DEBUG = "TRUE" then
debug1 => '1'
`end if
)
);
end architecture;
If DEBUG is FALSE, then the port map collapses to port map (P => () ). Empty aggregation lists are not supported.
--
Patrick Lehmann - 2017-01-09
Could we force a record aggregate that may be empty to use a qualified expression? In Patrick's example:
architecture A2 of E2 is
begin
inst : entity work.E1
port map (P => MyRecord'(
`if DEBUG = "TRUE" then
debug1 => '1'
`end if
)
);
end architecture;
--
Rob Gaddi - 2017-01-27
Version 2 created to use Rob's great idea.
--
Ryan Hinton - 2017-02-10
What happens for string'('A') is then the ('A') understood as a element of an aggregate?
string'() = ""
I am not saying that there are any issues, but there may be some rough edges
--
Jim Lewis - 2017-03-21