Re: POD doesn't capture code semantics

2008-03-10 Thread Steffen Schwigon
Ian Malpass <[EMAIL PROTECTED]> writes: > Andy Armstrong wrote: > >> =head2 C >> foo is a method... >> =head2 C >> bar is a subroutine... >> why not >> =method foo >> =sub bar >> > > How about: > > =for method > > =head2 C Just because no one seemed to have mentioned it

Re: POD doesn't capture code semantics

2008-03-07 Thread Ovid
--- David Cantrell <[EMAIL PROTECTED]> wrote: > > >>I wonder how you'd tag a subroutine that can be called as a > method or > > >>a regular subroutine. > > >:horrible_evil_delete_this_entire_file_to_be_safe > > /me makes notes. > > I'm with chromatic on this one. Doing that will make your brain

Re: POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
On 5 Mar 2008, at 20:21, David Cantrell wrote: I'm with chromatic on this one. Doing that will make your brain hurt. Especially if you do it to subroutines/methods that you create on the fly with AUTOLOAD. I wish I'd never dunnit. I wasn't actually advocating the practice :) -- Andy Armstro

Re: POD doesn't capture code semantics

2008-03-05 Thread David Cantrell
On Wed, Mar 05, 2008 at 07:07:24PM +, Andy Armstrong wrote: > On 5 Mar 2008, at 18:59, chromatic wrote: > >On Wednesday 05 March 2008 10:52:11 Andy Armstrong wrote: > >>I wonder how you'd tag a subroutine that can be called as a method or > >>a regular subroutine. > >:horrible_evil_delete_this_

Re: POD doesn't capture code semantics

2008-03-05 Thread Adriano Ferreira
On Wed, Mar 5, 2008 at 4:57 PM, Andy Armstrong <[EMAIL PROTECTED]> wrote: > On 5 Mar 2008, at 19:53, Mark Overmeer wrote: > >> So now we just need to backport that to Perl 5 and convert every > >> extant POD parsing tool. What could possibly go wrong? > > > > Damian has made an implementation i

Re: POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
On 5 Mar 2008, at 19:53, Mark Overmeer wrote: So now we just need to backport that to Perl 5 and convert every extant POD parsing tool. What could possibly go wrong? Damian has made an implementation in Perl5: http://search.cpan.org/~dconway/Perl6-Perldoc-v0.0.5/ That doesn't help with par

Re: POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
On 5 Mar 2008, at 19:36, Adriano Ferreira wrote: The S26 (Synopsis 26) is the official document: latest version here http://feather.perl6.nl/syn/S26.html Heh. And there it all is under "Semantic blocks" :) So now we just need to backport that to Perl 5 and convert every extant POD parsing t

Re: POD doesn't capture code semantics

2008-03-05 Thread Adriano Ferreira
On Wed, Mar 5, 2008 at 4:28 PM, Andy Armstrong <[EMAIL PROTECTED]> wrote: > On 5 Mar 2008, at 19:23, Adriano Ferreira wrote: > > =for method > > > > has the least impact (if the next paragraph is left blank). According > > to the specs, it should be understood as leave the paragraph alone if >

Re: POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
On 5 Mar 2008, at 19:23, Adriano Ferreira wrote: =for method has the least impact (if the next paragraph is left blank). According to the specs, it should be understood as leave the paragraph alone if you (POD processor) does not know about 'method'. Ah, OK. Thanks. That's all legal POD that

Re: POD doesn't capture code semantics

2008-03-05 Thread Adriano Ferreira
On Wed, Mar 5, 2008 at 3:35 PM, David Golden <[EMAIL PROTECTED]> wrote: > On Wed, Mar 5, 2008 at 1:06 PM, Ian Malpass <[EMAIL PROTECTED]> wrote: > > How about: > > > > =for method > > > > =head2 C > > > > Bit ugly, but it should work. Additional stuff after "method" could > > p

Re: POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
On 5 Mar 2008, at 19:05, David Golden wrote: Unfortunately, I just tested this and it isn't passed through to a parser automatically -- so this will only work for metadata, not actual documentation So =for :method =head2 C =cut sub my_method { } seems to work. And perlpodspec allows text

Re: POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
On 5 Mar 2008, at 18:59, chromatic wrote: On Wednesday 05 March 2008 10:52:11 Andy Armstrong wrote: I wonder how you'd tag a subroutine that can be called as a method or a regular subroutine. :horrible_evil_delete_this_entire_file_to_be_safe /me makes notes. -- Andy Armstrong, Hexten

Re: POD doesn't capture code semantics

2008-03-05 Thread David Golden
On Wed, Mar 5, 2008 at 1:52 PM, Andy Armstrong <[EMAIL PROTECTED]> wrote: > I wonder how you'd tag a subroutine that can be called as a method or > a regular subroutine. Is > > =begin :method|sub > > legal? > > I can't see a definition of what characters are allowed in an > identifier in perl

Re: POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
On 5 Mar 2008, at 18:50, Ian Malpass wrote: The backwards-compatibility thing is important if you want your docs to be widely read by a disparate audience. Your suggested syntax renders a document near-useless (totally missing headers, plus error messages) if the POD reader isn't "enhanced P

Re: POD doesn't capture code semantics

2008-03-05 Thread chromatic
On Wednesday 05 March 2008 10:52:11 Andy Armstrong wrote: > I wonder how you'd tag a subroutine that can be called as a method or   > a regular subroutine. :horrible_evil_delete_this_entire_file_to_be_safe -- c

Re: POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
On 5 Mar 2008, at 18:35, David Golden wrote: Also, more generally, consider that formats that begin with a colon are treated as POD and parsed as normal (c.f. perlpodspec and the "= :biblio" example). So consider this in combination with the X<> tag mentioned above : =begin :method =head

Re: POD doesn't capture code semantics

2008-03-05 Thread Ian Malpass
Andy Armstrong wrote: Yeah, that could work. I wonder which is more likely to gain traction: * backwards compatible / slightly verbose * incompatible / concise I suppose either would be adopted if there were tools that made good use of it. And the backwards compatible approach clearly has the

Re: POD doesn't capture code semantics

2008-03-05 Thread David Golden
On Wed, Mar 5, 2008 at 1:06 PM, Ian Malpass <[EMAIL PROTECTED]> wrote: > How about: > > =for method > > =head2 C > > Bit ugly, but it should work. Additional stuff after "method" could > provide more metadata, etc. A simpler option might be to use the X<> indexing mark: =head2 X>

Re: POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
On 5 Mar 2008, at 18:06, Ian Malpass wrote: Andy Armstrong wrote: =head2 C foo is a method... =head2 C bar is a subroutine... why not =method foo =sub bar How about: =for method =head2 C Bit ugly, but it should work. Additional stuff after "method" could provide mor

Re: POD doesn't capture code semantics

2008-03-05 Thread Ian Malpass
Andy Armstrong wrote: =head2 C foo is a method... =head2 C bar is a subroutine... why not =method foo =sub bar How about: =for method =head2 C Bit ugly, but it should work. Additional stuff after "method" could provide more metadata, etc. Ian

POD doesn't capture code semantics

2008-03-05 Thread Andy Armstrong
Last night, not for the first time, I found myself irritated that POD has no semantic concept of the code it describes. POD's a great markup language but it'd be nice if it were possible to associate chunks of POD with bits of code. Instead of =head2 C foo is a method... =head