lua-users home
lua-l archive

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


On Tue, 18 Oct 2011 15:00:34 -0500, Timothy Baldridge wrote:

int function(int a){
 int b;
 #include "other_file.h"
 return a + b;
}

// other_file.h
b = 42;

Yes that does work, never mind that that enables all sorts of
atrocities, and in general this pattern of programming should be
avoided.

Not necessarily, it is used a lot in image processing libraries
to separate huge matrices from source code files. It is quite
similar to the use of loadfile() in Lua.