Skip Menu |
Report information
Id: 126893
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: lloyd.fourn [at]

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Subject: 'use' named arg munging is evil
To: "rakudobug [...]" <rakudobug [...]>
Date: Sun, 13 Dec 2015 15:06:45 +0000
From: Lloyd Fournier <lloyd.fourn [...]>
Download (untitled) / with headers
text/plain 757b

perl6 -e 'use Test do { => 2015); ()}'

Default constructor for 'Date' only takes named arguments

This example is fairly golfed, but you can run into this in the wild.

Consider a module that has an EXPORT sub and takes positional arguments. If you tried to do 

use MyModule year => 2015) # you will get the error

I don't really get why the arguments to 'use' don't just use normal invocation semantics, with the positionals taken out and passed to export and the named used for normal importing.

unless $*IN_DECL eq 'use' || $*IN_DECL eq 'no' || $*IN_DECL eq 'import' || $*IN_RETURN {



This is the line in Actions.nqp that makes 'use' special.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at