The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

    • G+ These are the command-line parameters I assembled to get close to “Ultra” compression from the 7-zip... 1 hour ago
    • Getting close to 7zip GUI “Ultra” compression from a batch file… 1 hour ago
    • RT @Nick_Craver: Nothing of what I planned to do today got done. Nothing. Nothing at all. But we kept the error count under 2.5 million beh… 8 hours ago
    • RT @kellabyte: I really don’t get the harsh criticism around Intel 3D XPoint. Yes they didn’t deliver persisted RAM. They did deliver 8x… 8 hours ago
    • G+ “Some managers just don’t recognize how profound the differences between their people are; others don’t... 9 hours ago
  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,347 other followers

Delphi analog to C# ?? null-coalescing operator and Light Table like debugger evaluation

Posted by jpluimers on 2017/09/05

Interesting stuff:


In more detail:

Source: 2016-10-15 – Zenryokuwawa


  TObjectHelper = class helper for TObject
    class function &&op_LogicalOr(A, B: T): T; static;

class function TObjectHelper.&&op_LogicalOr(A, B: T): T;
  if A <> nil then
    Result := A
    Result := B;

procedure Test;
  sl1, sl2, sl3: TStringList;
  sl1 := nil;
  sl2 := TStringList.Create;
  sl3 := sl1 or sl2; // -> sl3 = sl2


3 Responses to “Delphi analog to C# ?? null-coalescing operator and Light Table like debugger evaluation”

  1. rvelthuis said

    The TObjectHelper thing is amazing. It also works on classes, and I already managed to do addition, or to write a helper that gives TStrings an in operator. It is simply a cool find.

    • jpluimers said

      It’s indeed one of the language additions I like a lot.

      • sglienke said

        It’s a feature by accident – I hope they will add it as an official feature. Some operators are harmless to introduce for classes also on non ARC. Also introducing operator overloads per helper is a good thing and should be supported officially rather than having to use some compiler glitch.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: