Lecture 10 Notes

7 8 d 6 5 4 could

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: General form of  ¢  This creates a variant-record data type, named type-name. There are one or more variants, and every value of the data type is a value of exactly one of the variants. Each variant has a variant-name and zero or more fields, each with its own field-name and associated predicate. Having zero fields is useful:   "¡¦¡§  ¡ 3D¤§©¨¥ ¦§ ©§ ¤  § ¢¢  ¡¡"   §    ¡  §¥¡ 9¨©©§¤ 4 ¨© ©1¤ $©!¢¢¤ ©¨¥ ¤ §¥ ¡ 4 ¡ ¡§ £¡   In languages like C or Java, a variable of type can be either null or a “real” , so these languages confuse and . Then you have to remember when you have to check for and when can get away without it. We’ll use constructions like this to keep them nice and separate.  ©§¤ 4 ¡ 27    §    ¡ ¢ ¡"   28   ¡" ¡   ¡   ¤¢¡ £  ¡ ¤ £ ¡ ¢ ¥§ ! ¤ ¡  £  A ¡ ¤ £ ¡ 9%¢ ¥§ ...
View Full Document

This document was uploaded on 03/17/2014 for the course CSG 111 at Northeastern.

Ask a homework question - tutors are online