mwatts15 / Crono

Scheme project for CS345
0 stars 0 forks source link

Add structures to Crono. #9

Closed tvarney closed 11 years ago

tvarney commented 11 years ago

Description

Add structures to Crono similar to C structs.

Requirements

  1. Support for defining new structures
  2. Support for creating new instances of a structure.
  3. Getting and Setting fields from the structure.
  4. Default arguments for fields should be able to be given in the structure definition.
  5. Allow structs to extend other structs.

    Example

(struct Person (name gender age))
(substruct Employee Person (position (wage 7.25) boss))
(let troy (newstruct Employee
    ((name "Troy")
     (gender "Male")
     (age 21)
     (position "Software Engineer")
     (wage 20.25)
     (boss "Alex"))
(troy name))