Marco Cantů Object Pascal Handbook

Total Page:16

File Type:pdf, Size:1020Kb

Marco Cantů Object Pascal Handbook 2 - Marco Cantù Object Pascal Handbook October 2014 Draft A first draft of the “Complete Guide to the Object Pascal programming language”, based on the compilers produced by Embarcadero Technologies Piacenza (Italy), October 2014 Marco Cantù, Object Pascal Handbook - 3 Author: Marco Cantù Publisher: Marco Cantù Editor: Peter W A Wood Cover Designer: Fabrizio Schiavi (www.fsd.it) Copyright 1995-2014 Marco Cantù, Piacenza, Italy. World rights reserved. The author created example code in this publication expressly for the free use by its readers. Source code for this book is copyrighted freeware, distributed via the web site http://code.marcocantu.com. The copy- right prevents you from republishing the code in print or electronic media without permission. Readers are granted limited permission to use this code in their applications, as long at the code itself is not distributed, sold, or commercially exploited as a stand-alone product. Aside from this specific exception concerning source code, no part of this publication may be stored in a retrieval system, transmitted, or reproduced in any way, in the original or in a translated language, including but not limited to photocopy, photograph, magnetic, or other record, without the prior agreement and written permission of the publisher. Delphi and Appmethod are trademarks of Embarcadero Technologies. Other trademarks are of the respective owners, as referenced in the text. The author and publisher have made their best efforts to prepare this book, and the content is based upon the final release of the software. The author and publisher make no representa- tion or warranties of any kind with regard to the completeness or accuracy of the contents herein and accepts no liability of any kind including but not limited to performance, merchantability, fitness for any particular purpose, or any losses or damages of any kind caused or alleged to be caused directly or indirectly from this book. The Object Pascal Handbook, October 2014 Draft. ISBN-10: * ISBN-13: * Electronic edition licensed to Embarcadero Technologies Inc. Any other download or sale outlet is likely to be illegal. Do not distribute the PDF version of this book without permission. Print edition to become available as the book is completed in early 2015. More information on http://www.marcocantu.com/objectpascal Marco Cantù, Object Pascal Handbook 4 - begin begin Power and simplicity, expressiveness and readability, great for learning and for pro- fessional development alike, these are some of the traits of today's Object Pascal, a language with a long history, a lively present, and a brilliant future ahead. Object Pascal is a multi-facet language. It combines the power of object-oriented programming, advanced support for generic programming and dynamic constructs like attributes, but without removing support for more traditional style of proce- dural programming. A tool for all trades, with compilers and development tools embracing the mobile era. A language ready for the future, but with solid roots in the past. What is the Object Pascal language for? From writing desktop apps to client-server applications, from massive web server modules to middleware, from office automa- tion to apps for the latest phones and tablets, from industrial automated systems to Internet virtual phone networks... this is not what the language could be used for, but what it is currently used for today, in the real world. The core of the Object Pascal language as we use today comes from its definition in 1995, a terrific year for programming languages, given that this was the year Java and JavaScript were also invented. While the root of the language dates back to its Pascal ancestor, its evolution didn't stop in 1995, with core enhancements continu- ing as of today, with the desktop and mobile compilers build by Embarcadero Technologies and found in Appmethod, Delphi, and RAD Studio. Marco Cantù, Object Pascal Handbook begin - 5 A Book on Todays' Language Given the changing role of the language, its extension over the years, and the fact it is now attracting new developers, I felt it important to write a book that offers com- plete coverage of the Object Pascal language as it is today. The goal is to offer a language manual for new developers, for developers coming from other similar lan- guages, but also for old timers of different Pascal dialects that want to learn more about recent language changes. Newcomers certainly need some of the foundations, but given changes have been pervasive even old-timers will find something new in the initial chapters. Beside a short Appendix covering the short history of the Object Pascal language, this book was written to cover the language as it is today. A large part of the core fea- tures of the language hasn't changed significantly since the early versions of the Delphi, the first implementation of modern Object Pascal in 1995. As I'll hint throughout the book, the language has been far from stagnant during all of these years, it has been evolving at quite a fast pace. In other books I wrote in the past, I followed a more chronological approach, covering classic Pascal first, and fol- lowing extensions more or less as they appeared over time. In this book, however, the idea is to use a more logical approach, progressing through the topics and cover- ing how the language works today, and how to best use it, rather than how it evolved over time. As an example, native data types dating back to the original Pascal lan- guage have method-like capabilities (thanks to intrinsic type helpers) introduced recently. So in Chapter 2 I'll introduce how to use this feature, although it won't be until much later than you'll figure out how to make such custom type extensions. In other words, this book covers the Object Pascal language how it is today, teaching it from the ground up, with only a very limited historical perspective. Even if you have used the language in the past, you might want to skim thought the entire text looking for newer features, and not focus only on the final chapters. Learn by Doing The idea of the book is to explain core concepts and immediately present short demos that readers are encouraged to try to execute, experiment with, and extend to understand the concepts and assimilate them better. The book is not a reference manual, explaining what the language should do in theory and listing all possible corner cases. While trying to be precise, the focus is more on teaching the language offering a practical step-by-step guide. Examples are generally very simple, because the goal is to have them focused on one feature at a time. Marco Cantù, Object Pascal Handbook 6 - begin The entire source code is available in a subversion repository, rather than a down- load file, so that you can easily update your code in case I publish any changes or additional demos. You can use any subversion client (my personal preference on Windows is for TortoiseSVN) and point it to the following HTTP URL to get all of the demos of the book (alternatively you can also check out individual chapters): http://code.marcocantu.com/svn/marcocantu_objectpascalhandbook/ The repository source code can also be browsed online by selecting the “Browse” link in the code repository wiki page at: http://code.marcocantu.com/trac/marcocantu_objectpascalhandbook To compile and test it the demo code, you'll need one of the available versions of the Object Pascal compiler, and possibly a recent one to compile them all. There are trial versions available that you can use, generally allowing you a 30-days free use of the compiler. Appendix C explains how to get started with the available IDEs. A Companion Web Site The book has a companion web site with further information, links, updates and more. There are both a static, traditional site with information at: http://www.marcocantu.com/objectpascalhandbook and online pages on Google+ (using a bit.ly link) and Facebook at http://bit.ly/objectpascalgplus https://www.facebook.com/objectpascalhandbook Acknowledgments As any book, this volumes owes a lot to many people, too many to list one by one. The person who shared most of the work on the book was my editor, Peter Wood, who kept bearing with my ever changing schedule and was able to smoothen my technical English very significantly as usual, helping to make this book (like my pre- vious handbooks) what it is. Given my current work position as product manager at Embarcadero Technologies, I owe a lot to all my my coworkers and the members of the R&D team, as during my time at the company my understanding of the product and its technology has further increased thanks to the insight I got in countless conversations, meetings, and email threads. Marco Cantù, Object Pascal Handbook begin - 7 Other people outside Embarcadero continued being important for this, from the cur- rent group at Wintech Italia, to the countless customers, Embarcadero sales and technical partners, Delphi community members, MVPs and even developers using other languages and tools I keep meeting so often. And finally big thank you goes to my family for bearing with my travel schedule, nights of meetings, plus some extra book writing on weekends. Thanks Lella, Benedetta, and Jacopo. About Myself, the Author My name is Marco and I've spent most part of the past 20 years writing, teaching, and consulting on software development with the Object Pascal language. I wrote the Mastering Delphi best-selling series and later self-published several Handbooks on the development tool (about the different versions from Delphi 2007 to Delphi XE).
Recommended publications
  • NET Core & Linux
    .NET Core & Linux Fabio Di Peri [email protected] Twitter: @kipters Telegram: @kipters Linux Day 2020 | .NET Core & Linux “ I went into .NET thinking this was a programming language, but it seems I've stumbled upon a mini operating system with support for multiple execution environments, programming languages, and now I have so many questions. — Kelsey Hightower (@kelseyhightower) July 30, 2020 “ Linux Day 2020 | .NET Core & Linux Multiple execution environments .NET Framework .NET Core Mono .NET Micro .NET Nano CoreRT Linux Day 2020 | .NET Core & Linux Multiple languages C# F# VB Linux Day 2020 | .NET Core & Linux Multiple languages C# F# VB C++ Python PHP ... Linux Day 2020 | .NET Core & Linux Codice CIL CLR Linux Day 2020 | .NET Core & Linux Codice CIL CLR Java bytecode JVM Linux Day 2020 | .NET Core & Linux CLR | Common Language Runtime "La JVM" CLR Mono CoreCLR Linux Day 2020 | .NET Core & Linux BCL | Base Class Library L'intero set di librerie e classi a disposizione delle applicazioni .NET Linux Day 2020 | .NET Core & Linux Nuget Linux Day 2020 | .NET Core & Linux dotnet CLI Linux Day 2020 | .NET Core & Linux 1995 Java Linux Day 2020 | .NET Core & Linux 1996 Anders Hejlsberg Linux Day 2020 | .NET Core & Linux 1996 Anders Hejlsberg Turbo Pascal Delphi Linux Day 2020 | .NET Core & Linux 1996 Anders Hejlsberg Turbo Pascal Delphi C# TypeScript Linux Day 2020 | .NET Core & Linux Visual J++ 1.1 Linux Day 2020 | .NET Core & Linux Visual J++ 6.0 Linux Day 2020 | .NET Core & Linux Visual J++ 1.x Abbraccia Java Linux Day 2020 | .NET Core
    [Show full text]
  • Microsoft Macro Assembler Version 5.1.PDF
    Microsoft. Macro Assembler Version 5.1 • For the MS® OS/2 or MS-DOS® Operating System Microsoft Macro Asset bier version 5.1 puts all the speed and power of assembly-lar uage programming within easy reach. Make your programs run faster by linking assembly-language subroutines to your Microsoft QuickBASIC, BASIC compiler, C, FORTRAN, and Pascal programs. Technical Highlights If you're accustomed to programming beyond the level of documentation the correct model for your subroutine, in a high-level language like Microsoft supplied with previous versions of just use the MODEL directive and choose QuickBASIC, BASIC compiler, QuickC, Microsoft Macro Assembler. This totally the model you need. To start your data C, FORTRAN, or Pascal, Microsoft revised guide provides a complete and segment, just add a DATA directive; Macro Assembler version 5.1 is the bridge well-organized explanation of Microsoft to create a stack, add a STACK directive; you've been looking for to the assembly- Macro Assembler and the instruction and to begin writing instructions, use language environment. You can, for sets it supports. the CODE directive. example, use the powerful graphics func- What's more, the Mixed-Language High-level language interface tions of Microsoft QuickBASIC or the Programming Guide included with Micro- macros help you declare your subroutines, efficient math functions of Microsoft soft Macro Assembler version 5.1 con- set up stack parameters, and create local FORTRAN and then add time-critical tains complete, easy-to-follow instructions variables. In addition, version 5.1 offers routines in Microsoft Macro Assembler. on how to call assembly-language sub- MS-DOS interface macros that make it Easier to learn and use.
    [Show full text]
  • Rapid Application Development Software | Codegear RAD Studio
    RAD Studio 2010 Product Review Guide August 2009 Corporate Headquarters EMEA Headquarters Asia-Pacific Headquarters 100 California Street, 12th Floor York House L7. 313 La Trobe Street San Francisco, California 94111 18 York Road Melbourne VIC 3000 Maidenhead, Berkshire Australia SL6 1SF, United Kingdom RAD Studio 2010 Reviewer Guide TABLE OF CONTENTS Table of Contents ............................................................................................................................ - 1 - Introduction ...................................................................................................................................... - 3 - General Overview of RAD Studio 2010 ...................................................................................... - 3 - What is New in RAD Studio 2010 ............................................................................................... - 3 - A Word on Delphi Prism ............................................................................................................. - 6 - Prerequisites ................................................................................................................................ - 7 - Minimum System Requirements ................................................................................................. - 7 - Internationalizations .................................................................................................................... - 7 - Editions ........................................................................................................................................
    [Show full text]
  • RPC Broker 1.1 Deployment, Installation, Back-Out, and Rollback Ii May 2020 (DIBR) Guide
    RPC Broker 1.1 Deployment, Installation, Back-Out, and Rollback (DIBR) Guide May 2020 Department of Veterans Affairs (VA) Office of Information and Technology (OIT) Enterprise Program Management Office (EPMO) Revision History Documentation Revisions Date Revision Description Authors 05/05/2020 8.0 Tech Edits based on the Broker REDACTED Development Kit (BDK) release with RPC Broker Patch XWB*1.1*71: • Changed all references throughout to “Patch XWB*1.1*71” as the latest BDK release. • Updated the release date in Section 3. • Updated all project dates in Table 4. • Added a “Skip This Step” note in Section 4.3.2. • Updated “Disclaimer” note in Section 4.8. • Added “Skip Step ” disclaimer to Section 4.8.1. • Deleted Sections 4.8.1.3, 4.8.1.3.1, and 4.8.1.3.2, since there are no VistA M Server routines installed with RPC Broker Patch XWB*1.1*71. • Updated Section 4.8.2.1.4; deleted Figure 3, “Sample Patch XWB*1.1*71 Installation Dialogue (Test System),” since there are no VistA M Server routines installed with RPC Broker Patch XWB*1.1*71. • Updated Section 5.2; Added content indicating install is only on Programmer-Only workstations. • Updated Section 5.6.1; added a “Skip Step” disclaimer and deleted Figure 9, “Restoring VistA M Server Files from a Backup Message,” since there are no VistA M Server routines RPC Broker 1.1 Deployment, Installation, Back-Out, and Rollback ii May 2020 (DIBR) Guide Date Revision Description Authors installed with RPC Broker Patch XWB*1.1*71.
    [Show full text]
  • Instructors Prerequisites Time Commitment and Schedule
    Instructors Anders Hejlsberg - Anders is a prominent Danish software engineer who co-designed several popular and commercially successful programming languages and development tools. He was the original author of Turbo Pascal and the chief architect of Delphi. He currently works for Microsoft as the lead architect of C# and core developer on TypeScript. Dan Wahlin - Dan Wahlin founded The Wahlin Group (http://www.TheWahlinGroup.com) which provides consulting and training services on Web technologies such as JavaScript, TypeScript, jQuery, AngularJS, SPAs, HTML5, ASP.NET and SharePoint. Dan is a Microsoft Regional Director and has been awarded Microsoft's MVP award multiple times for ASP.NET, Connected Systems and Silverlight. Dan blogs at http://weblogs.asp.net/dwahlin and writes regular columns for various technical magazines. Follow Dan on Twitter @DanWahlin. Prerequisites Working knowledge of JavaScript and experience coding in an object-oriented programming language. Time Commitment and Schedule 3-5 hours per week for 6 weeks. For students taking this course “live” content will be released twice per week typically on Tuesday and Thursday. Also note that all deadlines and release times are in UTC. This course will cover the following topics: Introduction to the TypeScript language Setting up your environment to work with TypeScript Understanding basic types Functions in TypeScript TypeScript classes (basics, constructors and inheritance, and properties) Interfaces in TypeScript Generics in TypeScript Deadlines and Grading Exercises are not graded but students will be asked to confirm that they have completed each homework assignment successfully as a part of the module assessment and will receive points for affirming that they have completed the exercises.
    [Show full text]
  • PETER STEPHENS Current Technical Pursuits: Agile Practices, Cloud
    PETER STEPHENS 512.778.6322 / cell 865.567.7173 1955 County Road 202 www.diligentsoftware.com/resume Liberty Hill, TX 78642 [email protected] Current Technical Pursuits: Agile Practices, Cloud Computing and Amazon Web Services, Cloud Automation, ASP.NET MVC, REST based web services, JavaScript and jQuery CURRENT SKILLS • Microsoft.NET Framework versions 1.0 – 4.5 » C#, LINQ, XML , Networking, Regular Expressions, Multithreading , Task Parallel Library, Encryption, etc. » Websites: ASP.NET WebForms and MVC » Thick Client: Windows Presentation Foundation (WPF) » Web Services: WCF, Web API (REST and RPC) , and OData • Cloud Computing » Amazon Web Services : EC2 , S3 , RDS , SQS, SNS, Cloud Formation, Route 53, etc. » Rackspace Cloud • Automation : Powershell, MSBuild, and T4 templating • Agile Practices : Continuous Integration with Team City and CruiseControl.NET, Test Driven Development (TDD ), NUnit, Rhino Mocks, MOQ, Autofac, and ReSharper • Microsoft SQL Server versions 7 – 2008. Extensive use of T-SQL , C# stored procedures, C# functions, management and database optimization • HTML , CSS , JavaScript , jQuery , HTTP, Web Design, SEO , and Microsoft Expression Studio, Report Viewer Control based RDLC reports • Domain Specific Languages: Irony • Deployment: WIX , InstallShield, and WebDeploy • Source Control : Git and Mercurial, Beyond Compare, KDIFF OPEN SOURCE AND SOCIAL • Stack Overflow: http://stackoverflow.com/users/72860/peter-stephens • Twitter: https://twitter.com/#!/peterastephens • Bitbucket: https://bitbucket.org/pstephens/
    [Show full text]
  • Delphi XE2 Feature Matrix
    Delphi® XE2 The fastest way to build native applications for Windows, Mac and iOS Feature Matrix Feature Architect Ultimate Enterprise Professional Starter INTEGRATED COMPILERS Enhanced in XE2! High-performance 32-bit optimizing Delphi® native code compiler 23.0 (dcc32), including High performance x86 Assembler – 32-bit inline assembler supporting the Intel® x86 instruction set (including Intel Pentium® Pro, Pentium III, X X X X X Pentium 4, Intel MMX™, SIMD, Streaming SIMD Extensions, SSE, SSE2, SSE3, SSE 4.1, SSE 4.2, AMD SSE4A and AMD® 3DNow!® New in XE2! Delphi 64-bit compiler X X X X New in XE2! Delphi OS X compiler X X X X Delphi command line compiler (dcc32.exe) X X X X Enhanced in XE2! Create 32-bit optimized Delphi native executables that can run X X X X X on both 32 and 64-bit Windows operating systems APPLICATION PLATFORMS, INTEGRATED FRAMEWORKS, DESIGNERS, SDKS AND INSTALLERS New in XE2! FireMonkey Platform for creating 32-bit Windows applications for X X X X X Windows 7, Windows Vista and XP; Server 2003 and 2008. New in XE2! FireMonkey Platform for creating 64-bit Windows applications for X X X X Windows 7, Windows Vista and XP; Server 2003 and 2008. New in XE2! FireMonkey Platform for creating OS X 10.6 and 10.7 applications X X X X New in XE2! FireMonkey Platform for creating applications for iOS 4.2 and higher X X X X New in XE2! VCL (Visual Component Library) for rapidly building 64-bit applications X X X X for Windows 7,Windows Vista and XP; Server 2003 and 2008.
    [Show full text]
  • The Delphi Language for Mobile Development
    This document is an introduction to changes in the “Mobile” version of Delphi and the new Delphi ARM compiler. The focus of this document is to highlight the language changes and techniques that can be used to port existing code and to maintain backwards compatibility. Author: Marco Cantu, Delphi Product Manager, Embarcadero Technologies (suggest updates and integrations to [email protected]). Written with very significant technical contributions by Allen Bauer and the help of many reviewers. Document Revision: 1.0 Moving Delphi to mobile ARM platforms is part of a larger evolution for the Delphi language. As such, the R&D team here at Embarcadero adopted a new architecture that will be common among all Embarcadero languages. Rather than building the compiler and all of the related tools (often indicated with the term “toolchain”) in a completely proprietary and autonomous way, we decided to leverage an existing compiler and tool chain infrastructure that has broad industry support, making it faster for us to add new platforms and operating systems in the future as market demands change. Specifically, the new generation of Delphi compilers (and also the C++Builder compilers) utilize the LLVM architecture. What is this LLVM and why does this matter? Let’s take a quick look at LLVM, and return to our main topic later. The LLVM project has its main web site with a detailed description at http://llvm.org In short, LLVM is “a collection of modular and reusable compiler and tool-chain technologies”. Despite the name (which was originally an acronym, but it is now considered as “the full name of the project”), LLVM has little to do with virtual machines.
    [Show full text]
  • Software License Agreement (EULA)
    Third-party Computer Software AutoVu™ ALPR cameras • angular-animate (https://docs.angularjs.org/api/ngAnimate) licensed under the terms of the MIT License (https://github.com/angular/angular.js/blob/master/LICENSE). © 2010-2016 Google, Inc. http://angularjs.org • angular-base64 (https://github.com/ninjatronic/angular-base64) licensed under the terms of the MIT License (https://github.com/ninjatronic/angular-base64/blob/master/LICENSE). © 2010 Nick Galbreath © 2013 Pete Martin • angular-translate (https://github.com/angular-translate/angular-translate) licensed under the terms of the MIT License (https://github.com/angular-translate/angular-translate/blob/master/LICENSE). © 2014 [email protected] • angular-translate-handler-log (https://github.com/angular-translate/bower-angular-translate-handler-log) licensed under the terms of the MIT License (https://github.com/angular-translate/angular-translate/blob/master/LICENSE). © 2014 [email protected] • angular-translate-loader-static-files (https://github.com/angular-translate/bower-angular-translate-loader-static-files) licensed under the terms of the MIT License (https://github.com/angular-translate/angular-translate/blob/master/LICENSE). © 2014 [email protected] • Angular Google Maps (http://angular-ui.github.io/angular-google-maps/#!/) licensed under the terms of the MIT License (https://opensource.org/licenses/MIT). © 2013-2016 angular-google-maps • AngularJS (http://angularjs.org/) licensed under the terms of the MIT License (https://github.com/angular/angular.js/blob/master/LICENSE). © 2010-2016 Google, Inc. http://angularjs.org • AngularUI Bootstrap (http://angular-ui.github.io/bootstrap/) licensed under the terms of the MIT License (https://github.com/angular- ui/bootstrap/blob/master/LICENSE).
    [Show full text]
  • Công Nghệ Thông Tin Và Truyền Thông
    DANH MỤC TÀI LIỆU CHUYÊN NGÀNH CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG Danh mục tài liệu bao gồm những tài liệu về: Khoa học máy tính; Công nghệ phần mềm; Kỹ thuật máy tính, Hệ thống thông tin, Truyền thông và mạng máy tính Bạn đọc có thể tham khảo những tài liệu này tại phòng đọc chuyên ngành 411; 419; 526; 304 STT TÀI LIỆU KHOA HỌC MÁY TÍNH Công nghệ thông tin : Tổng quan và một số vấn đề cơ bản / Phan Đình Diệu, 1 Quách Tuấn Ngọc , Nguyễn Thúc Hải... KHXG: QA75.5 International journal of computer and engineering management / Assumption 2 University. KHXG: QA75.5 3 Advances in information storage system. Volume 7 / Bharat Bhushan editor. KHXG: QA75.5 .A102-i V.7-1996 4 Advances in information storage system. Volume 8 / Bharat Bhushan editor. KHXG: QA75.5 .A102-i V.8-1998 Foundations of information and knowledge systems : third international 5 symposium, FoIKS 2004 : Wilheminenburg [sic] Castle, Austria, February 17-20, 2004 : proceedings / Dietmar Seipel, Jose Maria Turull-Torres (eds.). KHXG: QA75.5 .F435-o 2004 Hội thảo khoa học quốc gia lần thứ hai về nghiên cứu, phát triển và ứng dụng Công 6 nghệ thông tin và truyền thông : ICT.rda' 04. Hà Nội ngày 24-25/9/2005 / Vũ Đình Cự, Đỗ Trung Tá KHXG: QA75.5 .H452t 2005 2010 IEEE-RIVF international conference on computing and communication 7 technologies: Research, innovation and vision for the future : Vietnam national university, Hanoi Vietnam: November 1-4, 2010 / Tu Bao Ho,...[et.al.].
    [Show full text]
  • Type Extensions, Wirth 1988
    Type Extensions N. WIRTH lnstitut fijr Informatik, ETH, Zurich Software systems represent a hierarchy of modules. Client modules contain sets of procedures that extend the capabilities of imported modules. This concept of extension is here applied to data types. Extended types are related to their ancestor in terms of a hierarchy. Variables of an extended type are compatible with variables of the ancestor type. This scheme is expressed by three language constructs only: the declaration of extended record types, the type test, and the type guard. The facility of extended types, which closely resembles the class concept, is defined in rigorous and concise terms, and an efficient implementation is presented. Categories and Subject Descriptors: D.3.3 [Programming Languages]: Language Constructs-data types and structures; modules, packuges; D.3.4 [Programming Languages]: Processors-code generation General Terms: Languages Additional Key Words and Phrases: Extensible data type, Modula-2 1. INTRODUCTION Modern software development tools are designed for the construction of exten- sible systems. Extensibility is the cornerstone for system development, for it allows us to build new systems on the basis of existing ones and to avoid starting each new endeavor from scratch. In fact, programming is extending a given system. The traditional facility that mirrors this concept is the module-also called package-which is a collection of data definitions and procedures that can be linked to other modules by an appropriate linker or loader. Modern large systems consist, without exception, of entire hierarchies of such modules. This notion has been adopted successfully by modern programming languages, such as Mesa [4], Modula-2 [8], and Ada [5], with the crucial property that consistency of interfaces be verified upon compilation of the source text instead of by the linking process.
    [Show full text]
  • Differences Between Oberon and Oberon–2
    Oberon2.Differences.Text (20 Jul 93) 0 Differences between Oberon and Oberon–2 H. Mössenböck, N. Wirth Institut für Computersysteme, ETH Zürich Oberon–2 is a true extension of Oberon [1]. This paper summarizes the extensions and tries to shed some light on the motivations behind them. By that we hope to make it easier for the reader to classify Oberon–2. For details the reader is referred to the language report. One important goal for Oberon–2 was to make object–oriented programming easier without sacrificing the conceptual simplicity of Oberon. After three years of using Oberon and its experimental offspring Object Oberon [2] we merged our experiences into a single refined version of Oberon. The new features of Oberon–2 are type–bound procedures, read–only export of variables and record fields, open arrays as pointer base types, and a with statement with variants. The for statement is reintroduced after having been eliminated in the step from Modula–2 to Oberon. Oberon–2 is the result of many discussions among all members of the Institute for Computer Systems at ETH. It is particularly influenced by the ideas of Jürg Gutknecht and Josef Templ. Type–bound procedures Procedures can be bound to a record (or a pointer) type. They are equivalent to methods in object–oriented terminology. The binding is expressed by a separate parameter (the operand to which the procedure is applicable, or the "receiver" as it is called in object–oriented terminology). TYPE Figure = POINTER TO FigureDesc; FigureDesc = RECORD x, y, w, h: INTEGER END; PROCEDURE (f: Figure) Draw; BEGIN ..
    [Show full text]