{$APPTYPE CONSOLE}
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
uses SysUtils;

type
  users_t = (tarasB, superhackkiller1997, other_shit);
  say_ptr_t = class(TObject)
    anon_field1: users_t;
    constructor Create(usr: users_t);
    procedure anon_method(str: PChar);
  end;
const
  users: array[users_t] of PChar = ('tarasB', 'superhackkiller1997', 'other_shit');

procedure say_ptr_t.anon_method(str: PChar);
begin
  Writeln(ErrOutput, Format('%s: %s', [users[anon_field1], str]))
end;

constructor say_ptr_t.Create(usr: users_t);
begin
  inherited Create;
  anon_field1 := usr;
end;

function bind1(usr: users_t): say_ptr_t; export;
begin
  bind1 := say_ptr_t.Create(usr)
end;

begin
  bind1(tarasB).anon_method('shit');
  bind1(superhackkiller1997).anon_method('i''m god');
  bind1(other_shit).anon_method('ko-ko-ko')
end.