T
tjmkiely
I have a basic question about expressions as parameters to blocks.
If I pass and expression as the parameter to a block, is it possible to
get the string representation of the expression before evaluation.
For example, with the following block:
write = proc { |x| file.write("x:#{x})")}
If called like this:
write[request.domain]
I would like to have this printed:
request.domain: localhost
Thanks.
If I pass and expression as the parameter to a block, is it possible to
get the string representation of the expression before evaluation.
For example, with the following block:
write = proc { |x| file.write("x:#{x})")}
If called like this:
write[request.domain]
I would like to have this printed:
request.domain: localhost
Thanks.