Skip Menu |

This queue is for tickets about the File-Map CPAN distribution.

Report information
The Basics
Id: 53218
Status: resolved
Priority: 0/
Queue: File-Map

People
Owner: LEONT [...] cpan.org
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: docs of $lvalue prototype
Date: Wed, 30 Dec 2009 11:42:59 +1100
To: bug-File-Map [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
In the File::Map pod it'd be good to make clear that the $lvalue string parameter to each function is by prototype, and thus in fact a scalar ref if using the functions by indirect calls &$func(\$mstr,...) or by a require like require File::Map; File::Map::map_handle (\$str, ...); I've been using this latter when only optionally wanting an mmap. (This sort of difference between calls is of course one of the many reasons not to use prototypes. What's gained in compile-time checking or syntax is lost in uniformity and generality!)
Hi Kevin, I've been pondering about this ticket for some time, and the use case you've mentioned convinced me to drop prototypes (except the one on wait_until for reasons that should be obvious). This will mean a small break of API. I'm planning to release this soon, but I'm waiting for perl 5.12.0 to be released (as it fixes a longstanding bug that is rather relevant for memory mapping). If your module depends on the current behavior it may be a good idea to synchronize updating them. Regards, Leon
Subject: Re: [rt.cpan.org #53218] docs of $lvalue prototype
Date: Sun, 28 Mar 2010 07:27:08 +1100
To: bug-File-Map [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Leon Timmermans via RT" <bug-File-Map@rt.cpan.org> writes: Show quoted text
> > drop prototypes
Beaut. Show quoted text
> (except the one on wait_until
I expect you could keep the code block prototype and drop the scalar ref prototype. Putting "sub" if using by runtime require wouldn't be hard and probably matches most codeblock-passing packages. Show quoted text
> If your module depends on the current behavior
Yes, as it stands. (File::Locate::Iterator, with mmap used variously "if_sensible", "if_possible", etc, with File::Map recommended but not mandatory :-). Show quoted text
> it may be a good idea to synchronize updating them.
Yep.
On Sat Mar 27 16:27:39 2010, user42@zip.com.au wrote: Show quoted text
> > (except the one on wait_until
> > I expect you could keep the code block prototype and drop the scalar ref > prototype.
Yeah, that's what I meant.
I'm uploading 0.24 now. I had to wait so long for 5.12 that it has more changes than I'd like, but it still feels like a solid release. Leon