Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immutable and persistent data structures (a la Clojure) #11

Closed
xiaq opened this issue Jun 10, 2014 · 3 comments
Closed

Immutable and persistent data structures (a la Clojure) #11

xiaq opened this issue Jun 10, 2014 · 3 comments

Comments

@xiaq
Copy link
Member

xiaq commented Jun 10, 2014

It would be nice to follow clojure's approach and have immutable data structures by default.

Pros:

  1. Facilitates concurrency

  2. Avoids the reference vs. value semantics problem; consider the following in Python:

    >>> a = [[1]] * 5
    >>> a
    [[1], [1], [1], [1], [1]]
    >>> a[0][0] = 2
    >>> a
    [[2], [2], [2], [2], [2]]

However, we'd better still have $env and namespaces as mutable maps.

@xiaq xiaq added PART-eval and removed design labels Jun 10, 2014
@xiaq xiaq changed the title Immutable data structures (a la Clojure) Immutable and persistent data structures (a la Clojure) Jul 29, 2014
@xiaq
Copy link
Member Author

xiaq commented Jul 29, 2014

http://hypirion.com/musings/understanding-persistent-vector-pt-1 is a nice introduction to the Clojure implementation of persistent vectors.

@xiaq
Copy link
Member Author

xiaq commented Sep 20, 2014

An implementation of selected persistent data structures was pushed to https://github.com/xiaq/persistent some while ago.

@xiaq xiaq removed the PART-eval label Feb 24, 2015
This was referenced Feb 26, 2015
@xiaq
Copy link
Member Author

xiaq commented Jan 27, 2016

Abandoned.

@xiaq xiaq closed this as completed Jan 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant