|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- wrap.lua: wrapping strings in other strings.
-- This file:
-- http://angg.twu.net/dednat5/wrap.lua
-- http://angg.twu.net/dednat5/wrap.lua.html
-- (find-angg "dednat5/wrap.lua")
--
-- (find-es "lua5" "mult-as-comp")
-- Make (f*g)(a, b, c) behave as f(g(a, b, c))
debug.setmetatable (print, {
__mul = function (f, g) return
function (...) return f(g(...)) end
end,
})
wrap = function (fmt_or_pre, post)
if post then
return function (str) return fmt_or_pre..str..post end
else
return function (str) return format(fmt_or_pre, str) end
end
end
--[[
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile "wrap.lua"
wrap_center = wrap "\\hbox to 0pt{\\hss %s\\hss}}"
wrap_dollar = wrap "$%s$"
= (wrap_center * wrap_dollar)("hello")
--]]
-- Local Variables:
-- coding: raw-text-unix
-- End: