Friday, September 14, 2012

hook problems


 it is important that you concentrate now on being able to commit your work in git. I give you below the reason for the error you got so far, that should be easy to correct.

On 09/02/2012 10:52 PM, Ricardo Aguirre wrote:
I already solved the 13)

My error was incredible stupid!

Now I have problems with git
last week I setup my global git configuration on my pc, I used this email: <>

now I'm getting this errors:

Ok, you're having hook problems. We have a hook that checks that the code you commit complies to GNAT style checks before allowing you to commit them. You can check these rules on your computer by compiling with switch -gnatyg. Many of these rules are so simple (indentation, spacing) that you can correct them in GPS by clicking on a small icon on the side that says "autofix". BTW, you can set up GPS so that it does the indentation automatically for you. I am joining the Ada Coding Style that we use at AdaCore.

at first it yields
raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : failed precondition from

Then I removed the old push precondition (not Is_Full(S))
now is running
I guess it's ok, but here it would really help that you commit the questions and your current answers in a file that I can inspect.

I'm stocked with generics, I already read many chapters of ada book, but I'm doing something wrong, I hope I'll solve it during this weekend.
Now I see that stack example is really classic, and book talk about it in many chapters, actually I feel little embarrassed cause I'm having problems with really basic stuffs. However I'm working in.
Don't worry, the goal of this exercise is precisely to help you figure out the problems in a simplified setting, so that we can help you more easily before you attack the real library.

To solve this point I have to ideas:
a) do not use anymore the array instead use a list, like the Cell example
Yes, that's what we had in mind.

b) Use a type base, and then all objects inserted on the array should be
subtype of this base type. Doing an analogy with java that each object
extends implicitly from Object Class.
We have the same notion of derivation in Ada: an object of type T'Class can be dynamically of any type derived from T. Except you cannot put T'Class objects in an array, because they do not have a fixed size. So the solution is really to use pointers.

When I tried to use your suggested postcondition
it yields:
/raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : failed postcondition from instantiated at main.adb:5/

I'm not pretty sure about the reason of this message.

Either your postcondition is wrong, or your implementation of Push is wrong. At least they do not match. Try inspecting values by debugging or printing to see which one it is.

No comments:

Post a Comment