vendredi 6 mars 2015

Unnamed records in Ada



In Java, you would be able to do something like this:


ArrayList.add(new Object(int arg1, int arg2);


creating an object without a name and adding it to a list, making it easy to use in a loop.


How would I do similar in Ada using records?


I have a record:



type Food is
record
Name: Character;
Taste: Integer;
end record;


How would I create instances of the record and add it to an array without naming them?




Aucun commentaire:

Enregistrer un commentaire