• 0 Posts
  • 284 Comments
Joined 2 years ago
cake
Cake day: July 1st, 2023

help-circle



  • Clojure has it’s own set of idioms; it comes with some small surprises for old lisp hands. There are some things it’s really brought into the mainstream: performant persistent data structures in particular.

    As well as excellent tooling and pedagogy, the principle attraction of Racket is the macro system. There’s a great book about this (this is true of just about all aspects of Racket). Racket’s focus is on building a tower of languages via macro extension. Metaprogramming is thematically FP-adjacent but neither sufficient or necessary; but if you’re looking for a fun learning experience it’s really worth a look.

    In terms of employment opportunities - I know of several Clojure shops (on the JVM it has the bonus of being able to take advantage of the hole ecosystem), but I’m not aware of anywhere that’s using Racket outside of the academic sphere.

















  • It won’t (using your example explicitly) but in general what you’ve discovered is that:

    1. Variables hold values
    2. Some of those values are references to shared mutable objects.

    Lists fall into the second category. There are ways to copy lists if you want distinct behaviour.

    list2 = list1[:]
    

    will perform a “shallow copy”. If you have a list of lists, however, the nested lists are still shared references. There is copy.deepcopy available to make a complete clone of something (including all its nested members).