New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parameterisation has higher priority than postcircumfix:<[ ]> even on non-parameterizable types #4458
Comments
From @LLFournContext: I am trying to make a fun syntax where Class[@args] is an alias class C {}; I also tried: role R { method parameterize(|) { say $*d; } }; But I can't use dynamic variables because if it's called with a compile I tentatively suggest that at least one of these is a bug as they together |
From @jnthnOn Thu Aug 06 06:18:57 2015, lloyd.fourn@gmail.com wrote:
The syntax TypeName[...] is syntactically a type parameterization, by design. If you really want to force interpretation as an array indexing, it'd have to be written as: C.['test']; #-> win
Yes, and we're allowed to form parametric types at compile time whenever we know we have the parameters available (and if we can't do that, we have a lot of problems; for one it's the very mechanism that allows you to `does` a parametric role on a class declaration!) A parameterize method that isn't prepared to be called at compile time is buggy.
Both behaviors are as intended. In general, anything of the form `<typename> <postcircumfix>` should be considered a special form. It's a pity we have to overload bracketing chars, but sadly ASCII is a bit limiting! Thanks, Jonathan |
The RT System itself - Status changed from 'new' to 'open' |
@jnthn - Status changed from 'open' to 'rejected' |
From @LLFournMakes sense. I went with TypeName{'arg'} and TypeName<arg> instead of On Wed, Oct 7, 2015 at 2:53 AM, jnthn@jnthn.net via RT <
|
Migrated from rt.perl.org#125762 (status was 'rejected')
Searchable as RT125762$
The text was updated successfully, but these errors were encountered: