Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is assignment with "let" not against the idea of functional programming in Clojure

Assignment should avoided in functional programming, but in clojure we often use let.

Is let just a way of being practical or is assignment not the same as using let? Should we not avoid assignment in functional programming?

like image 871
David Avatar asked Nov 16 '25 03:11

David


1 Answers

It's fair to say that mutable state is generally against the core concepts of functional programming.

However, let merely binds a name to a value. If that value is itself immutable, there's no reason for it to be inconsistent with functional programming ideals.

like image 155
Chris Avatar answered Nov 17 '25 21:11

Chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!