3 ms·
Is that nested-define common racket style? I know it's been legal, at least since R4RS, but I've never seen it actually done.
by oddthink 8y ago
Is that nested-define common racket style? I know it's been legal, at least since R4RS, but I've never seen it actually done.
- widdershins 8y agoNot sure if it's common amongst Racketeers, but I've used it a few times in R6RS Scheme. It can help reduce nesting in complicated functions. But in these simple cases I think most would reach first for `let`.
- soegaard 8y agoYes, you can see the style guide here. https://docs.racket-lang.org/style/Choosing_the_Right_Construct.html#%28part._.Definitions%29 https://docs.racket-lang.org/style/Choosing_the_Right_Constr... The reasoning is that `define` doesn't increate horisontal indentation.