Code Monkey home page Code Monkey logo

zipper's Introduction

Zipper Build Status

A datastructure, first described by Huet, is used to traverse and manipulate immutable trees. This library is a port of the zipper implementation found in Clojure.

Usage

The zipper module provides several functions for creating a Loc object which represents the current focal point in the tree.

>>> import zipper
>>> top = zipper.list([1, [2, 3], 4])

>>> print top.down().right().node()
[2,3]

>>> print top.down().right().down().node()
2

>>> print top.down().right().down().replace(0).root()
[1, [0, 3], 4]

zipper's People

Contributors

srobertson avatar swagile1 avatar graingert avatar

Stargazers

 avatar Shawn Zhang avatar Marco Federighi avatar Peppe avatar Alessandro Pappalardo avatar Dominic LoBue avatar Emma Doyle avatar Aaron Hosford avatar Andrew NS Yeow avatar  avatar mago avatar rmuslimov avatar Carlos Martin avatar Frank Siler avatar Kris Wilson avatar  avatar Will O'Brien avatar Jameel Al-Aziz avatar Richard Hull avatar Lionel Barret avatar Nicholas Pezolano avatar Michael Hood avatar Jacques Crocker avatar

Watchers

 avatar Luke Pacholski avatar James Cloos avatar scott@zeepmobile.com avatar  avatar

zipper's Issues

TypeError: 'module' object has no attribute '__getitem__'

When i try to run the zipper.py file using python 2.7 in macOS i get this error:

Traceback (most recent call last):
  File "zipper.py", line 18, in <module>
    native_list = __builtins__['list']
TypeError: 'module' object has no attribute '__getitem__'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.