Texas, Start Your Photocopiers

Oxygene, modern Pascal, began in the 2000s with the goal of providing a modern, elegant version of Object Pascal to the world. While it is backwards compatible with legacy Delphi constructs, Oxygene has led with a significant number of language features grounded in practical usefulness and modern idioms, ranging from async/await to tuples.

RAD Studio 13 adds a new language feature to Delphi, a ternary operator. It’s a great feature, useful ever since ALGOL 60 introduced it sixty-five years ago. Naturally Oxygene has had a Pascal implementation of a ternary operator for many years.

We do want to congratulate Delphi on adding this language feature. It’s very useful: RemObjects customers have had it for years, and more recently even other Pascal dialects, and it’s great that Delphi users can finally benefit too.

Perhaps case expressions could be next? Here’s what Oxygene can do with a case statement (on strings) used as an expression:

var awesome := case Text of
  'hello': 'User said hi';
  'oxygene': 'User said Awesome!';
  'modernity': 'Check out tuples sometime.';
  else '...';
end;
write($'The value of awesome is {awesome}');

Oh, and a bit of string interpolation in that last line too.

Whatever Delphi does next, we hope they’ll continue to let us inspire them — when it comes to the Pascal language, we’ve blazed the trail, and we’ve defined the syntax. You can get it first here, folks.

Interested in Oxygene? Genuinely modern Pascal? Read about ‘Delphi Island’ ie compiling your Delphi projects with Oxygene, or read what’s new and amazing compared to Delphi here. There’s never been a better time to upgrade.