develooper Front page | perl.perl5.porters | Postings from September 2022

Re: module loading built-in

Thread Previous | Thread Next
From:
Darren Duncan
Date:
September 17, 2022 00:50
Subject:
Re: module loading built-in
Message ID:
9c2c0ac6-26b9-38ff-e0bb-96bb7ec0ca45@darrenduncan.net
On 2022-09-16 7:44 a.m., Branislav Zahradník wrote:
> IMHO better solution will be to provide namespace specific methods, eg:
> Foo::Bar::->*is_loaded
> Foo::Bar::->*load
> 
> grammar rule:
> NAMESPACE_LITERAL ARROW STAR method
> 
> and so on
> 
> Advantage:
> - namespace methods will not pollute namespace for other methods
> - namespace methods will always be prefixed with *

Is this a situation where we want to start having special syntax for particular 
method calls?  If so, we probably want to look at such a feature more 
holistically, not just for this use case.  I also recall discussions of 
something similar, specifically adding Raku-like twigils to Perl, was rejected 
in Corinna design discussions in respect to object attributes.  Also, how would 
this proposed design work in situations where the package name is only known at 
runtime, such as because it came from a configuration file? -- Darren Duncan


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About