| CPAN Ratings (Gamma) constant-defer reviews | |
| Home | Search | About | Login |
RSS | Module Info | Add a review of constant-defer
3 out of 5 found this review helpful:
This is a fine module. It has one caveat that the author understands, but doesn’t call out in the documentation: unlike real constants, the deferred constants produced by this module won’t be inlined in any code that is compiled before the deferred calculation has been triggered. So depending on why you are using constants instead of other mechanisms like read-only variables, this module may or may not be of use to you. This is a fundamental caveat; it is not possible to resolve without special support in the compiler and op tree.
(As for Burak Gürsoy’s negative review, please ignore. He criticises that this module injects weird subs – in Perl, all constants are subs of a particular form (cf. the source of constant.pm). He also criticises the use of goto – in Perl, goto has several forms, one of which provides an explicit tail call, which form is quite commonly used, particularly in all sorts of meta-programming. I found nothing surprising or unusual in my reading of the module’s source.)
Aristotle Pagaltzis - 2009-11-02 21:29:38
Was this review helpful to you?
Yes
No
This module does not create constants but injects weird subs into your package that gains value after first call. Code itself is implemented with several goto()s and seems to be highly error prone. Also the distro reached v2 in a month. Wow!. If you need such a thing implement them as functions or object methods instead. There is a reason calling something a "constant". Stay away.
[Update] Reply To Aristotle Pagaltzis: Do not assume anything about a person you don't even know and read the both sources to see what they are doing.
Burak Gürsoy - 2009-10-31 10:42:49
Was this review helpful to you?
Yes
No
This if to offset the very negative previous review
given by someone who seemingly adopted an attitude
"if I don't understand it, it cannot be good".
I've never used the module in question myself,
but the docs are reasonably complete, and the code looks clean and tidy. The deferral approach is sane, too.
Grrrr - 2009-10-31 03:16:26
Was this review helpful to you?
Yes
No
|
|
|