Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cbosgd.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!ihnp4!cbosgd!mark From: mark@cbosgd.UUCP (Mark Horton) Newsgroups: net.lang Subject: Re: Language Comparison, Stacks, etc Message-ID: <435@cbosgd.UUCP> Date: Fri, 14-Oct-83 14:59:23 EDT Article-I.D.: cbosgd.435 Posted: Fri Oct 14 14:59:23 1983 Date-Received: Sun, 16-Oct-83 10:59:21 EDT References: <103@houxk.UUCP> Organization: AT&T Bell Laboratories, Columbus Lines: 23 C not only has variant records (e.g. unions), but it is possible to have DYNAMIC sized records, of a sort. E.g. struct string { short length; char body[1]; } *p; ... p = malloc(sizeof (struct string) + strlen(str)); p->length = strlen(str); strcpy(p->body, str); Try doing THAT in Pascal! A display is not part of the Pascal Language. It's a technique a compiler writer can use in a block structured language to implement block structure. It's basically an array of frame pointers, one for each level of static scoping. There are other implementations, for example the P compiler uses a "static link" to the stack frame of the next static level - to reference a variable 3 levels out, you follow a chain of static pointers of length 3. There is a special pointer for global variables, since they are a common case. In ordinary Pascal programs that aren't nested very deep, this works reasonably well, but in a deeply nested program a display can be much much faster.