Exp Lua |
|
The latest explua tarball can be found here at the Wiki: Files:wiki_insecure/users/miller/explua.tar.gz Be warned that this is a public site and hence the code is inherently untrusted. First and foremost, there should only be lua files inside the package.
An example of LaTeX (well, later converted to PS using my own macros, etc) content can be found at Files:wiki_insecure/users/miller/concur.ps.gz.
On Sunday 19 October 2003 20:32, Reuben Thomas wrote: > I intend to fix on a system to use soonish (to make the libraries more > easily usable), so it would be nice to know how ExpLua works even if it's > not ready yet.Okay. I've been working on the system as a whole in an adaptive, progressive, iterative refining methodology -- i.e., sometimes kludging for twenty minutes, sometimes designing/building/testing whole bunches of the stuff throughout the night -- mostly geared towards automatically documenting functions and modules for my thesis (which has a whole lot of them, and I didn't feel like writing stuff twice and maintaining them in both versions).
I started out by trying to use other systems available (e.g, LuaDoc?, JavaDoc?, and even literate programming), but found that they had a tendency to get way too much on the way of my bad programming habits. Sadly, they weren't strong and satisfying enough for me to drop my weakness and start designing correctly -- I would just get tired of typing the @param tags and stop commenting altogether.
So I figured I wanted a commenting system that was simpler to type when you're programming and easy to read even if you don't understand the specific comment format. I chose a system of glyphs as thus:
For the whole file:
--| Begins a module/file comment, e.g., "this file does *this*". --by Pedro Miller Rabinovitch <miller@inf.puc-rio.br> --$Id: myfile.lua,v 1.12 2003/10/17 00:13:56 miller Exp $ --TODO lots of stuff.
Preceding each function:
--% This is the purpose of the function, i.e., what it *does*. --- And this is the second line, which will concatenated to --- the others. --@ first (string) Text of the first parameter --@ what (table) The second parameter is the table used for an --- example --@ [...] (any) Optional parameters to the called whatever --: (number) Number of whatevers done or nil if an error occured function Module:MyFunction( first, what, ... )
That's basically it for now. There's some more stuff I'm planning ahead on (like --& and --. for important tables and fields, respectively, and I need I'm also going to need some kind of type-definition later on), but the important stuff is there.
The great thing about this is, now that it's become so simple, I'm documenting a lot more my code. And the more documentation I have, the more I want to extract it and generate stuff...
'nuff said. I had more to discuss here, but ain't got the time right now.