[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Registering a new function that wraps write(format())
- From: "Chris Percival" <cpercival@...>
- Date: Thu, 21 Feb 2002 15:07:10 -0000
Yes, but how would I do that from C? Maybe cheat and put that in a string
and called lua_dostring?
Chris Percival
Software Engineer
Interaxis Computing Ltd.
DDI: +44 (0)1249 700072
http://www.interaxis.co.uk/
> -----Original Message-----
> From: owner-lua-l@tecgraf.puc-rio.br
> [mailto:owner-lua-l@tecgraf.puc-rio.br]On Behalf Of Luiz Henrique de
> Figueiredo
> Sent: 21 February 2002 14:59
> To: Multiple recipients of list
> Subject: Re: Registering a new function that wraps write(format())
>
>
> >Is there an easy way of registering a new function that wraps
> >write(format()), but called somthing else like 'myprint' for example. I
> >guess I have to call 'format' with all the args, then pass the results to
> >'write'.
>
> function printf(...)
> write(call(format,arg))
> end
>
> printf("Hello from Lua %s at %s\n",_VERSION,date())
>
> --lhf