lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



A lot can be done also by consistent comments. And i _know_ that this is not an alternative for what you're saying, but it answers the original question on "what has been useful in big projects".

Bug (sorry: big ;P) in this case means Hamster, the build coordination tool that currently has fatted to 4813 lines (136kB!), all in one giant .lua file.

This is the comment style I use:

	-----
	-- [tbl]= ConfigFlags( cmd_str )
	--
	-- Usage:   i.e. 'CPPFLAGS= ConfigFlags("sdl-config --cflags")'
	--

Of course, there's a lot variation and some functions are _much_ more complicated. See hamster.lua for more.. ;)

-ak


7.7.2004 kello 14:50, Steve Donovan kirjoitti:

 adam@gimp.org 07/07/04 01:41PM >>>
Something along those lines is good (and necessary, for
overloading) but it doesn't entirely tickle my fancy in terms
of syntax... it looks too much like the natural syntax for
constructors.

How about this then:

  function foobar(x,y) ;   String(x);  MyClass(y);
     ...
  end

Looks just like old-fashioned K&R C  ;)

These functions of course contain the assert as Daniel has
them;  it could be possible to generate them automatically
from their underlying types.

There's always the _documentation_ aspect of parameter
types, of course, as Ivan points out.   I remember getting
confused looking at Python code, wondering what the hell
was _supposed_ to be passed to a function.

steve d.



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.