thindil

Joined 7 years ago

Karma
119
Submissions
8
Member since
Jan 1
Open Source developer, interested in safe and secure programming.

Homepage: https://www.laeran.pl/

View on Hacker News

Recent submissions

Comment · 5 years ago
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.

Comment · 5 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton