uhmanoa-transpiler-project / shaka-scheme

The official repository for the UH Manoa Transpiler Project's Scheme interpreter, Shaka Scheme.
32 stars 24 forks source link

Basic DataPair implementation (used for representing Scheme data pairs) #24

Closed CinchBlue closed 7 years ago

CinchBlue commented 7 years ago

First of all, there are a few background changes that I made for building, etc.:

In Data, certain changes were also made:

Here is a basic implementation of DataPairs that holds two references to other Data.

NodePtr is a using alias that resolves to std::shared_ptr<shaka::Data> for now. It is known that this implementation is broken if we are dealing with reference cycles that may appear due to the presence of circular lists, etc. We are expecting to replace this faulty implementation of managed data pointers in the future with a proper garbage collection system that is designed to detect cycle detection and break ownership chains as necessary for proper memory management.

It implements four major functions:

Please also review whether my implementation of deep copying of Data to other Data in the copy constructor in Data(const Data& other) is correct. I'm not sure if it is.

CinchBlue commented 7 years ago

Wrong commit. I have instead created a new branch that ends on the correct commit and have instead created a pull request from that: https://github.com/uhmanoa-transpiler-project/shaka-scheme/pull/25