Re: Passing expression as a parameter
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Passing expression as a parameter
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 9 Jan 2013 15:26:50 -0200
> lambda = function(def)
> local arrow = "->"
> local args,result = def:match("(.*)"..arrow.."(.*)")
> return load(args.."=... return "..result)
> end
Don't you have to escape '-' in arrow?
(Forgetting to escape '-' in Lua patterns is a common mistakel one that
I've made several times...)