// Make Object Functions for CS 51 Introduction to C // // File: make_object.cc // Author: () // Assignment: c // This file contains the object making functions for // programming the CS 51 LISP assignments in C++. #include "intro51.h" // Pseudo-code for make_symbol: // // Look up symbol in symbol table, and if found, // return it. // // Else make new symbol, fill in its type and name, // add it to symbol table, and return it. // // Pseudo-code for make_integer: // // Just like make_symbol, with value in place of // name. // // Pseudo-code for make_cons: // // Make new object, fill in type, car, and cdr, and // return the new object. // Function that returns -1, 0, or +1 according to // whether s1 is less than, equal to, or greater than // s2 when compared lexically (as in a dictionary). // int my_strcmp ( char * s1, char * s2 ) { return 0; // Replace this line with your code. } object * make_symbol ( char * name ) { return NIL; // Replace this with your code. } object * make_integer ( int value ) { return NIL; // Replace this with your code. } object * make_cons ( object * car, object * cdr ) { object * result = new object; result->type = CONS; result->car = car; result->cdr = cdr; return result; }