Mark Overmeer wrote:
* Damian Conway ([EMAIL PROTECTED]) [070622 09:02]:
> Mark Overmeer wrote:
> >Then, when you want to add some docs to the method, to help the
> >correct use, add it, for instance like:
> >
> >  method isValidPostalCode(str $postalcode) returns bool {...}
> >     ` Check wether the postal code confirms to the standards
> >     `$postalcode: a string with blanks trimmed.
> >     `return: the string is not cleaned-up.
> >
> >or maybe (exact syntax open to discussion)
> >
> >  method isValidPostalCode(str $postalcode) returns bool {...}
> >  #=  Check wether the postal code confirms to the standards
> >  #=$postalcode
> >  #=  a string with blanks trimmed.
> >  #=return
> >  #=  the string is not cleaned-up.
>
> Would the following syntax suffice?
>
>    method isValidPostalCode(str $postalcode) returns bool {...}
>    =PURPOSE  Check weather the postal code confirms to the standards
>    =ARG $postalcode
>        a string with blanks trimmed.
>    =RETURN
>        the string is not cleaned-up.
>
> Because you can already do precisely that in the current design of Pod 6.

This is syntactically what can be done with the current design,
but is semantically very different.

For the record, I find Damian's example to be considerably more readable.

The needs for my kind of documentation generators are very simple: the
Perl6 parser needs to collect all lines of docs which follow a certain
line with code into the AST node of that line or item.  The Perl6
parser itself doesn't need to do anything more than that.  Tools doing
introspection on the AST do the rest.

Please forgive my ignorance: what does "AST" stand for?

--
Jonathan "Dataweaver" Lang

Reply via email to