lua-users home
lua-l archive

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

>From Tue Jun 23 13:18:04 1998
>You have raised an interesting point there as well. Lua is designed as an
>embedded language but the way it outputs text is not very convenient for
>systems which can't trap the standard streams. ie. Windows (unless I'm
>missing something).

Lua is designed as an embedded language for ANSI C programs.
Any compiler that claims to support ANSI C *must* provide some implementation
the standard streams.
Think C on the Mac does this.
I don't know about Windows. Can someone please enlighten me here?

>You have to go through the Lua code and alter every
>printf, fprintf etc. to redirect the output to your buffer.

There are just a couple of such places:
	print in lbuiltin.c
	the standard error handler in ldo.c

Plus, you can always set your own error handler.

>What about having a function:  int lua_SendToOutput(FILE* stream, const
>char *pBuffer, ...);

I guess you can always write your own printf and fprintf and override the
compiler's implementation.