How to Design Programs: An Introduction to Programming and Computing

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
PLT MzLib: Libraries Manual PLT ([email protected]) 372 Released December 2007
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Copyright notice Copyright c 1996-2007 PLT Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Library General Public License, Version 2 published by the Free Software Foundation. A copy of the license is included in the appendix entitled “License.” Send us your Web links If you use any parts or all of the PLT Scheme package (software, lecture notes) for one of your courses, for your research, or for your work, we would like to know about it. Furthermore, if you use it and publicize the fact on some Web page, we would like to link to that page. Please drop us a line at [email protected] . Evidence of interest helps the DrScheme Project to maintain the necessary intellectual and financial support. We appreciate your help. Thanks Contributors to MzLib include Dorai Sitaram, Bruce Hauman, Jens Axel Søgaard, Gann Bierner, and Kurt Howard (working from Steve Moshier’s Cephes library). Publicly available packages have been assimilated from others, including Andrew Wright ( match ) and Marc Feeley (original pretty-printing implementation). This manual was typeset using L A T E X, SL A T E X, and tex2page . Some typesetting macros were originally taken from Julian Smart’s Reference Manual for wxWindows 1.60: a portable C++ GUI toolkit . This manual was typeset on December 28, 2007.
Image of page 2
Contents 1 MzLib 1 2 a-signature.ss : Whole-module Unit Signatures 3 3 a-unit.ss : Whole-module Units 4 4 async-channel.ss : Buffered Asynchronous Channels 5 5 awk.ss : Awk-like Syntax 6 6 class.ss : Classes and Objects 7 6.1 Object Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 6.2 Creating Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 6.3 Creating Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 6.3.1 Initialization Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.3.2 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.3.3 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.4 Creating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 6.5 Field and Method Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6.5.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.5.2 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6.5.3 Generics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6.6 Mixins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.7 Object Serialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.8 Object, Class, and Interface Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.9 Expanding to a Class Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 7 class100.ss : Version-100-Style Classes 26 i
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CONTENTS CONTENTS 8 cm.ss : Compilation Manager 28 9 cm-accomplice.ss : Compilation Manager Hook for Syntax Transformers 30 10 cmdline.ss : Command-line Parsing 31 11 cml.ss : Concurrent ML Compatibility 35 12 compat.ss : Compatibility 36 13 compile.ss : Compiling Files 38 14 contract.ss : Contracts 39 14.1 Flat Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 14.2 Function Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 14.3 Lazy Data-structure Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 14.4 Object and Class Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 14.5 Attaching Contracts to Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 14.6 Building New Contract Combinators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 14.7 Contract Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 15 control.ss : Control Operators 58 16 date.ss : Dates 62 17 deflate.ss : Deflating (Compressing) Data 63 18 defmacro.ss : Non-Hygienic Macros 64 19 etc.ss : Useful Procedures and Syntax 65 20 file.ss : Filesystem Utilities 70 21 foreign.ss : Foreign Interface 75 22 include.ss : Textually Including Source 76 ii
Image of page 4
CONTENTS CONTENTS 23 inflate.ss : Inflating Compressed Data 78 24 integer-set.ss : Integer Sets 79 25 kw.ss : Keyword Arguments 82 25.1 Required Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 25.2 Optional Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 25.3 Keyword Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 25.4 Rest and Rest-like Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 25.5 Body Argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 25.6 Mode Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 25.7 Property Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 26 list.ss
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern