Entomy / Ada-Improvements

Repository of Ada language improvement ideas
GNU General Public License v3.0
4 stars 0 forks source link

Type Conversion #19

Open Entomy opened 5 years ago

Entomy commented 5 years ago

Ada does:

F : Float := 1.34;
I : Integer := Integer(F):

It should be:

F : Float := 1.34;
I : Integer := F as Integer;

Rationale: Introducing an as operator fits with the general approach of Ada of using keywords in most places. Furthermore, it distinguishes this from a function call which it definately should not be viewed as. Introducing a well defined operator also helps #11.

as should be treated higher than the current highest_precedence_operator