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

type
  users_t = (tarasB, superhackkiller1997, other_shit);
  say_ptr_t = procedure (str: PChar) of object;
  anon_class_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 anon_class_t.anon_method(str: PChar);
begin
  Writeln(ErrOutput, Format('%s: %s', [users[anon_field1], str]))
end;

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


function bind(usr: users_t): say_ptr_t; export;
begin
  bind := anon_class_t.Create(usr).anon_method
end;

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