Implementation
Fortran

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
use Moops;
class T {
    has 's', is => 'ro', isa => Str;
    has 'n', is => 'ro', isa => ArrayRef[Int];
}

{
    my $v = T->new(s => 'Hello, world!', n => [1,4,9,16,25]);
    # deallocation happens at closing brace, see explanation
}
type
  TDynIntArray = array of integer;
  TT = record
    s: string;
    n: TDynIntArray;
  end;
  PTT = ^TT;

var
  v: PTT;
begin
  v := New(PTT);
  v^.s := 'Hello world';
  v^.n := TDynIntArray.Create(1,4,9,16,25);
  Dispose(v);
end.
class T:
    def __init__(self, s, n):
        self.s = s
        self.n = n
        return

v = T('hello world', [1, 4,  9, 16, 25])
del v