6 ms·
> "Let's make a function that has the side effect of introducing variables into scope. That's a great idea." And ``let'' is? ;-) Doing a (let [request] (check
by yeahbutbut 12y ago
> "Let's make a function that has the side effect of introducing variables into scope. That's a great idea."
And ``let'' is? ;-)
Doing a (let [request] (check-auth ...)) would be equally dumb. Let's not blame the tools.
- jsn 12y agoThat's not not how 'let' works, you can't do that with 'let'. You most definitely should blame the tools here.
- yeahbutbut 12y agoYou're right, let is a macro so you can't pass binding forms from a variable, my mistake. But surely Scheme has some function for binding variables to the local scope... My point is that trusting user input is the error, not having the ability to play with the scope.
- gdwatson 12y agoScheme has forms that add bindings to the local scope -- local defines -- but they're similar in spirit to let. There aren't any such functions in standard Scheme, and I don't know of any major implementation that has any. It's not clear how they would interact with macros or macro hygiene, and they would do unpleasant things to lexical scope which is Scheme's original schtick.