develooper Front page | perl.perl6.users | Postings from August 2019

Type name limit?

Mark Devine
August 14, 2019 00:29
Type name limit?
Message ID:
This is Rakudo version 2019.07.1 built on MoarVM version 2019.07.1 implementing Perl 6.d.

Is there a type “name” size limit in Perl 6/Rakudo/Moar?

I’ve been making a hierarchy of classes to take in a > 4MB XML file, and I found it organized & convenient to use the names of the elements for class names and folders/.pm6 file names.  Perl 6 lets me do this for a few levels, then eventually refuses to compile because the latest (deep-in-the-hierarchy) class I added & ‘use’ and type an attribute with ‘has’ – is deemed insufficient as a type.  (actually the compile error says the parent of the new class isn't sufficiently type-like anymore)

Hypervisor::IBM::POWER::HMC		# a REST API client package
  ::ManagedSystems			# xml root
    ::Managed-System			# etc.
            :: etc.
              :: etc.

Since I’ve encountered the compile error I’ve started folding the class files at an arbitrary level, but that’s not intuitive.  Implementing the hierarchy in the file system and class names seems much better.  (34" monitors are prevalent now)

If there is a type-name limit, then it would appear to be arbitrary.  Is it configurable?

Would anyone care to clarify?


Mark Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About