Dynamic allocations in Ada are a cinch by the way. We use the "new" reserved word.
subtype Hacker_News_Article_ID is Natural; -- Numbers 0 .. Integer'Last;
type Article_Handle is access all Hacker_News_Article_ID; -- "all" reserved word used allows access to variables on the stack.
Favorite_Article : aliased Hacker_New_Article_ID := 3793716; -- "aliased" so we can point to this stack variable.
Article_Pointer : Article_Handle := Favorite_Article'Access; -- A sensible default perhaps.
later on...
Article_Pointer := new Hacker_News_Article_ID (Whatever);
Good luck!
In practice, this means your Ada written image viewer can show you 1000 thumbnails, but no more. Or 10000, or some other hard limit. And you can only view images smaller than 2MP. Unless the author made the fixed sizes really large, but now you're burning 10MB of memory per image even if they're all tiny gifs.
A declaration like the one above is typically done on the stack (although it doesn't have to be). An array can be allocated on the heap with "new", with, IIRC, the following syntax: new Foo_Array (3..10)
new Foo_Array(x..y)
That's what I couldn't figure out how to do last I tried.