lua-users home
lua-l archive

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


On Saturday 13 August 2005 7:08 am, Lisa Parratt wrote:
> Surely the nice, clean, solution to your problems is some sort of
> Scheme like hygenic macro system?

i'm sure that would be the most generic solution, and there was a little 
discussion about how could it be.  as i recall, the biggest obstacle is that 
the compilation structures aren't very lua-friendly' making compile-time 
additions awkward. (unlike Scheme and other Lisps, where the interned program 
is just a list, like everything else)

maybe it could be enlighting to see if Dylan has this kind of features?  it 
has deep introspection, and made successfully the transition from a Lisp 
dialect to a more popular infix-operator procedural-like syntax.

> That way you could define whatever extra syntax you like in it's own
> package, and then include and activate it through a require

for this specific request, i think it's not needed... (untested!!)

function compose_r (f, ...)
    local given = arg
    return function (...)
        return f (unpack ( concat_lists (given, arg)))
    end
end

function compose_l (f, ...)
    local given = arg
    return function (...)
        return f (unpack ( concat_lists (arg, given)))
    end
end


-- 
Javier

Attachment: pgp1II87hfnIc.pgp
Description: PGP signature