2 ms·
Generally, your language has to expose a meta-object protocol like this itself. Perl5's Moose[0] did it without this, thanks to Perl5's extreme flexibility & ea
by falsedan 9y ago
Generally, your language has to expose a meta-object protocol like this itself. Perl5's Moose[0] did it without this, thanks to Perl5's extreme flexibility & easy ability to run code at the compile stage.
Your example is really describing a class; you could drop all the typing and it would still be a great question.
[0]: https://metacpan.org/pod/distribution/Moose/lib/Moose/Manual/Attributes.pod https://metacpan.org/pod/distribution/Moose/lib/Moose/Manual...