Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

If you are interested, Literate Programming provides much of the benefits of PDL, and additional benefits as well. You describe your program and define it in a series of named 'chunks' -- within a chunk, you may include other chunks. Then you define/refine each chunk. The chunk names are rather like the pseudo-code. The literate source code file may be 'tangled' into an actual source file, or 'woven' into a typeset document (LaTeX, HTML, or some other format depending the tools you are using).

So the root chunk (the chunk that defines the program) might look like (for a program called 'faqgrep'):

<<faqgrep>>= #!/usr/bin/perl -w use strict; <<initialize_variables>> <<read_in_perlfaq_filenames>> <<search_and_print>> <<faqgrep.pod>> @

And then later you'd create the definition for each of those included chunks (and those may include chunks as well). So you get stepwise refinement and flexible order of presentation (we don't have to present those chunks in the order given, though in a case such as above it probably makes more sense to go linearly). Each of these 'chunks' is preceded (and/or followed) by the explanatory text (usually in LaTeX). Tangling assembles the chunks into the proper order to create your source code, and weaving turns it into a typeset document with any indexing and cross-reference features you (and the LP tool) have implemented.

To find out more about LP: The faq is located here, and Mark-Jason Dominus has an article on perl.com. I use the noweb LP tool myself (not religiously though). I've been considering writing up a little introductory LP article for perlmonks, so let me know if you are interested.


In reply to Re: program design language - a reality? by danger
in thread program design language - a reality? by ailie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-20 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found