> On Oct 26, 2016, at 4:31 PM, David Mertens <dcmertens.p...@gmail.com> wrote:
> 
> Hello everyone,
> 
> I am writing a keyword hook, C::Blocks. I have realized that my hook could be 
> made more powerful if I could indicate optional type information for 
> variables.
> 
> Question 1: Perl has support for declaring a variable's type, but it is 
> intended to be used with the fields pragma. I get the impression that this is 
> rarely used and I want to use it for something entirely different. Can 
> anybody see a problem with this?

yes, I have a problem with that.
no, types are not only used for the field pragma.
cperl has proper type support and any "modern perl” needs type support.
B::CC, the optimizing compiler, has coretype support even in perl5. 
Every lexical has the optional type stash and better signature implementations 
set that also, 
so that perl5 can finally look like a modern perl as perl6 or cperl, but not 
like Moose/Mouse/Moo/… or even worse, 
old-style fields.

> Question 2: I want to keep the class names for the type system relatively 
> short. Can anyone think of problems for names such as:
> 
>  C::double_t
>  C::int_t
>  C::IV_t

See the cperl coretype names. If they are the same, use it, otherwise use your 
own variants.


Reini Urban
rur...@cpan.org

Reply via email to