From: Vincent Pit Date: Sat, 7 Mar 2009 12:04:18 +0000 (+0100) Subject: Revamp the description so that the important discussion about what the type can be... X-Git-Tag: v0.04~6 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLexical-Types.git;a=commitdiff_plain;h=f693737e7e11807a5386bdf639cf620367333be3 Revamp the description so that the important discussion about what the type can be comes sooner --- diff --git a/lib/Lexical/Types.pm b/lib/Lexical/Types.pm index 841c3aa..36960d8 100644 --- a/lib/Lexical/Types.pm +++ b/lib/Lexical/Types.pm @@ -50,10 +50,26 @@ BEGIN { =head1 DESCRIPTION -This pragma allows you to hook the execution of typed lexicals declarations (C). -In particular, it can be used to automatically tie or bless typed lexicals. +This pragma allows you to hook the execution of typed lexicals declarations (C) by calling a configurable method in a configurable package at each run. +In particular, it can be used to automatically tie or bless typed lexicals whenever they are initialized. -It is B implemented with a source filter. +Remind that for C to be able to parse C, you need : + +=over 4 + +=item * + +either the C package to be defined ; + +=item * + +or for C to be a constant sub returning a valid defined package. + +=back + +so make sure you follow one of those two strategies to define your types. + +This pragma is B implemented with a source filter. =cut @@ -193,7 +209,7 @@ or for C to be a constant sub returning a valid defined package. =back -Those restrictions apply even if you use the C<'as'> option to redirect to another package, and are unlikely to find a workaround as this happens deep inside the lexer - far from the reach of an extension. +The restrictions on the type (being either a defined package name or a constant) apply even if you use the C<'as'> option to redirect to another package, and are unlikely to find a workaround as this happens deep inside the lexer - far from the reach of an extension. Only one mangler or prefix can be in use at the same time in a given scope.