T
Thomas Hafner
Hello,
with a function like that
def let(*a)
yield(*a)
end
the scope of variables can be limited, e.g. like this:
let {
x = "foo"
# ... do something with x ...
# here's the end of scope of x
}
# ...
let {
x = "bar" # this is another, different x
# ... do something with x ...
}
Is there already a standard means working like this? If it's a
standard library function, what's its name?
Regards
Thomas
with a function like that
def let(*a)
yield(*a)
end
the scope of variables can be limited, e.g. like this:
let {
x = "foo"
# ... do something with x ...
# here's the end of scope of x
}
# ...
let {
x = "bar" # this is another, different x
# ... do something with x ...
}
Is there already a standard means working like this? If it's a
standard library function, what's its name?
Regards
Thomas