Further Reading — Chapter 11: Records and Variant Records

Official Documentation

  • Free Pascal Reference Guide — Records Free Pascal Documentation, Section 3.4: "Record types." https://www.freepascal.org/docs-html/ref/refse15.html The authoritative reference for record syntax, including variant records, packed records, and advanced features. Essential for understanding the exact rules of variant memory layout.

  • Free Pascal Reference Guide — Variant Parts in Records Free Pascal Documentation, Section 3.4.1. https://www.freepascal.org/docs-html/ref/refsu14.html Covers the precise semantics of variant records, free unions, and the relationship between the tag field and variant fields.

Books

  • Wirth, Niklaus. Algorithms + Data Structures = Programs (1976) Prentice Hall. Chapter 1: "Fundamental Data Structures." Wirth's classic text introduces records as one of the fundamental structuring mechanisms alongside arrays. His treatment is concise and deeply principled. Reading Wirth on records gives you the philosophy behind the feature, not just the syntax.

  • Jensen, Kathleen and Wirth, Niklaus. Pascal User Manual and Report (4th Edition, 1991) Springer-Verlag. Sections on record types and variant records. The original Pascal specification, co-authored by the language's creator. The discussion of variant records is particularly illuminating — it explains the design decisions that shaped this feature.

  • Dale, Nell and Weems, Chip. Pascal Plus Data Structures (4th Edition) Jones & Bartlett. Chapters on records and data abstraction. An accessible treatment that bridges records as a Pascal feature to records as a data abstraction concept. Good exercises and case studies.

  • Kernighan, Brian and Plauger, P.J. Software Tools in Pascal (1981) Addison-Wesley. A masterclass in structured programming with Pascal. Uses records throughout for real programs (text processing, sorting, file manipulation). Shows how records look in production-quality code.

Conceptual Background

  • Hoare, C.A.R. "Record Handling" (1966) In Programming Languages, ed. F. Genuys, Academic Press. Tony Hoare's influential paper on record structures, which directly influenced Wirth's design of records in Pascal. Hoare proposed the idea of discriminated unions (variant records) as a safe alternative to untyped memory access.

  • Cardelli, Luca and Wegner, Peter. "On Understanding Types, Data Abstraction, and Polymorphism" (1985) Computing Surveys, 17(4): 471–523. A foundational survey of type systems. Section on product types (records) and sum types (variant records / tagged unions) provides the theoretical framework for understanding why these constructs exist across many languages.

Modern Context

  • Rust Enums and Pattern Matching The Rust Programming Language Book, Chapter 6. https://doc.rust-lang.org/book/ch06-00-enums.html Rust's enum is the modern descendant of Pascal's variant record. Comparing the two shows how the same concept evolved over 40 years. Rust adds exhaustiveness checking and prevents accessing the wrong variant at compile time — problems Pascal leaves to the programmer.

  • TypeScript Discriminated Unions TypeScript Handbook, "Narrowing" section. https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions TypeScript's approach to tagged unions in a dynamically-typed-origin language. The pattern of checking a "kind" field before accessing variant-specific properties is identical to Pascal's case Kind of pattern.

Practice Resources

  • Project Euler — https://projecteuler.net/ Many problems benefit from using records to bundle related data (coordinates, number-theoretic properties, graph nodes). Try solving problems 11, 18, and 67 using arrays of records for grid data.

  • Rosetta Code — Pascal Examples https://rosettacode.org/wiki/Category:Free_Pascal Search for "record" to find Pascal implementations of various algorithms using records. Comparing different solutions to the same problem reveals different record design choices.

Historical Interest

  • Wirth, Niklaus. "Recollections about the Development of Pascal" (1993) ACM SIGPLAN Notices, 28(3): 333–342. Wirth reflects on why he designed Pascal the way he did. His discussion of records and variant records reveals the trade-offs he considered between safety, flexibility, and implementation simplicity.