About proc and binding

Hi,

I’m currently working on a dsl method that allows writing expressions
given though a proc:

dsl{ x > y }

I would like to be ensure that x and y are free variables in that proc,
meaning that:

x = 5
lambda{ puts x }.call

would result in a NameError: undefined local variable or method `x’.

Is this possible in ruby, i.e. overriding the binding of a proc object,
in
any way?

Thanks,
Bernard