Hacker News new | past | comments | ask | show | jobs | submit login

1. In the older versions of Ada standard, functions can't have side effects, in a sense that they are not allowed to return more than one value (by setting the function's parameter's mode to out). Procedures always allowed to have side effects.

2. Functions can be expression functions which can be set in the code specification or used in expressions. Procedures can be written only in packages' bodies.

3. Procedures can be set to no-return state: that kind of procedure doesn't end in the normal way, but, for example, only by raising an exception.

4. Procedures can be null procedures, empty. That not the same as abstract subprograms from other programming languages.

Also, the difference is, in my opinion, more visible in the safe subset of Ada, SPARK, where still exists the rule which forbids side effects on functions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: