HomeUpSign my Guestbook!RSS • Published: 2026-03-14 • Powered by IPFS

@ Syntax


Ada has a neat syntax since 2021.

X := @ * 2;

The @ always signifies the LHS of the assignment. Even in more complex situations like this:

Cursor(3, Next) := @ * 2 + Sqrt(@);

It’s a very nice way of doing all the +=, *=, |=, <<=, etc. which seems slightly more readable to me, for the basic cases I still learnt to see :=@+ as a +=, and in the more complex expressions where you don’t actually want to just have the final operation be + the old value, it comes in way more handy.

Ofc doing this with macros is trivial.