lua-users home
lua-l archive

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


>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