[FOSDEM] Call for Presentations: Ada DevRoom @ FOSDEM 2025

Actually, those are valid Ada 2012 no? Expression Functions

@JC001 What is not Ada 2012 then? I cannot spot it :confused:

Your Stack example is not valid Ada for any version, since Last is undefined. (Also you use “Stak” more than once in comments.)

As an experienced Ada user, I find the ligatures confusing in what is supposed to be code. Someone who doesn’t know Ada might be put off by thinking that you need to be able to type those symbols. I would prefer standard Ada compound symbols for these reasons.

The distinction between delta and small for an ordinary fixed-point type is important and something that anyone who uses them should know. That said, it wouldn’t have an impact for this example. You can specify the small with with Small => 0.01 (or for Better_Grade'Small use 0.01; pre-Ada-12) or by using a decimal fixed-point type.

To me it distracts from the point you’re making, so it would be better to eliminate the distraction.

I see now what you mean. The example was not meant to be exhaustive, but rather exemplary :slight_smile:

Thanks for the feedback. I will look for a nice looking monospace font without ligatures :slight_smile:

I thought about using a decimal type, but I do not want the viewers thinking too hard about this point. I just want to bring their attention to the fact that Ada has fixed point nums, but I do not want to spend time there. I will keep it as is even if some implementation details are not fully accurate.

I will make it Positive. To me this is not the focus of the discussion (which needs to be about Dynamic_Predicate). And to be fair, I copied that code from the SPARK User Guide, which included a few examples :slight_smile:

Best regards,
Fer

I understand. But if you tell people who don’t know Ada that you’re going to only present valid Ada (12), and then present invalid Ada, they will have an erroneous understanding of the language.

Ideally you would put the state in the package body, so that no one can corrupt the stack by writing a child package, and the full operations would then have to be in the body as well.

1 Like