Thanks Tristan - I noticed this behaviour but forgot to comment on it. For other interested parties, the relevant bit of the LRM is: --- quote For the evaluation of a type_conversion that is a value conversion, the operand is evaluated, and then the value of the operand is converted to a corresponding value of the target type, if any. If there is no value of the target type that corresponds to the operand value, Constraint_Error is raised; this can only happen on conversion to a modular type, and only when the operand value is outside the base range of the modular type. --- endquote Now, I can see the reasoning - without an explicit type-conversion (using 'mod), it's more in the VHDL-like "fail as early as possible" mindset. But perhaps without an explicit type-conversion you shouldn't be allowed to assign an integer to a modular type, so it should fail at compile-time? I imagine you've written rather more Ada code than I have, so could you elucidate a bit more on the problems the current Ada Behaviour causes please? You mention it is "error-prone". What would your preferred behaviour be - to fail at compile-time, or treat all assignments as asking for a "wraparound", or something else entirely? Thanks, Martin -----Original Message----- From: owner-vhdl-200x@eda.org [mailto:owner-vhdl-200x@eda.org] On Behalf Of tgingold@free.fr Sent: 25 June 2014 19:39 To: vhdl-200x@eda.org Subject: Re: [vhdl-200x] Modular types Hello, > So, are there any features you would like which are not mentioned? > Constraints which do not make sense? Ada made a mistake for type conversion to modular type: the expression is not reduced, which is not intuitive and error prone. (In Ada, a type conversion of a negative value to a modular type raises an error). Don't follow that! Regards, Tristan. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Thu Jun 26 00:34:23 2014
This archive was generated by hypermail 2.1.8 : Thu Jun 26 2014 - 00:35:05 PDT