Jump to content

Kryvich

Members
  • Content Count

    407
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Kryvich

  1. Kryvich

    Save some vertical space?

    I am for any changes that will make the interface less cluttered and more compact. If this can be achieved without additional plug-ins - it will be great.
  2. Kryvich

    Inline Variables Coming in 10.3

    Another observation. From the very beginning, we had this method of declaring procedures and functions: procedure procedureName(parameterList); localDeclarations; begin statements end; The reserved word begin marks the beginning of the procedure body. But starting from 10.3 local variables can be declared directly in the procedure body. Therefore, there is no need to save begin for procedures and functions: procedure procedureName(parameterList); localDeclarations; statements end;
  3. Kryvich

    Inline Variables Coming in 10.3

    I think inline vars and type inference will be especially usefull in functional programming with Delphi. Now we write like this: program TestClosure; {$APPTYPE CONSOLE} uses SysUtils; var Proc: TProc; begin Proc := (function: TProc var n: Integer; begin n := 0; Result := procedure begin Write(n); Inc(n); end; end)(); Proc; Proc; Proc; Proc; Readln end. In the new Delphi 10.3 Rio, this can probably be reduced to program TestClosure10_3; {$APPTYPE CONSOLE} uses SysUtils; begin var Proc := (function: TProc begin var n := 0; Exit(procedure begin Write(n); Inc(n); end); end)(); Proc; Proc; Proc; Proc; Readln end. BTW can you say what this code will display? Similar JavaScript code for comparison: var func=(function(){ var n = 0; return function(){ console.log(n); n++; } })(); func(); func(); func(); func();
  4. Kryvich

    Inline Variables Coming in 10.3

    Then the interface needs to know about the default class that implements it. Get circular references between units.
  5. Kryvich

    Inline Variables Coming in 10.3

    What's wrong with this code? It should create and return an object of TInterfacedObject type, isn't it? Well, it should be freed after use: Instance.Free;
  6. Kryvich

    Visual tweaks

    I agree. Avatars in messages need to be reduced in size from 138x138 to 42x42, as in the list of topics. Avatars in G+ are 45x45 in size, and that's enough. The caption "Members" can also be hidden, show only "Administrators", as implemented in G+. The number of posts and the Delphi version can be removed. All user information can be shown in the pop-up window when you hover on an user's avatar.
×