3 Builtins and Libraries🔗

This section contains information on libraries that come with Pyret.

    3.1 General-Purpose Libraries

      3.1.1 Global Utilities

        3.1.1.1 Built-in Utility Functions

        3.1.1.2 Built-in Types

        3.1.1.3 Type Predicates

      3.1.2 Numbers

        3.1.2.1 Number Annotations

        3.1.2.2 Number Literals

        3.1.2.3 Number Constants

        3.1.2.4 Number Functions

        3.1.2.5 Random Numbers

        3.1.2.6 Other Number Functions

      3.1.3 Strings

        3.1.3.1 String Functions

      3.1.4 Booleans

        3.1.4.1 Boolean Functions

      3.1.5 option

        3.1.5.1 The Option Datatype

        3.1.5.2 Option Methods

      3.1.6 either

        3.1.6.1 Data types

      3.1.7 pick

        3.1.7.1 The Pick Datatype

      3.1.8 lists

        3.1.8.1 The List Datatype

        3.1.8.2 The list Constructor

        3.1.8.3 List Methods

        3.1.8.4 List Functions

      3.1.9 sets

        3.1.9.1 The Set Type

        3.1.9.2 Using Sets in Programs

        3.1.9.3 Set Constructors

        3.1.9.4 Set Methods

      3.1.10 arrays

        3.1.10.1 Array Creation Functions

        3.1.10.2 Array Methods

        3.1.10.3 Array Functions

      3.1.11 string-dict

        3.1.11.1 The StringDict Type

        3.1.11.2 StringDict Constructor

        3.1.11.3 StringDict Methods

        3.1.11.4 The MutableStringDict Type

        3.1.11.5 MutableStringDict Constructor

        3.1.11.6 MutableStringDict Methods

      3.1.12 Tables

        3.1.12.1 Creating Tables

        3.1.12.2 Loading Tables

        3.1.12.3 Selecting Columns

        3.1.12.4 Filtering Tables

        3.1.12.5 Ordering Tables

        3.1.12.6 Transforming Tables

        3.1.12.7 Extracting Columns from Tables

        3.1.12.8 Extending Tables

          3.1.12.8.1 Mapping extensions

          3.1.12.8.2 Reducers

        3.1.12.9 Comparing Tables

        3.1.12.10 Advanced Table Manipulation

      3.1.13 gdrive-sheets

        3.1.13.1 The Spreadsheet Type

        3.1.13.2 The Worksheet Type

        3.1.13.3 Spreadsheet Functions

        3.1.13.4 Spreadsheet Methods

      3.1.14 csv

      3.1.15 color

        3.1.15.1 Data types

        3.1.15.2 Predefined colors

      3.1.16 The image libraries

        3.1.16.1 Data Types

        3.1.16.2 Basic Images

          3.1.16.2.1 Data types for drawing basic images

        3.1.16.3 Text

          3.1.16.3.1 Data types for text images

        3.1.16.4 Polygons

        3.1.16.5 Other images

        3.1.16.6 Overlaying Images

          3.1.16.6.1 Data types for aligning images

        3.1.16.7 Placing Images & Scenes

        3.1.16.8 Rotating, Scaling, Flipping, Cropping and Framing Images

        3.1.16.9 Bitmaps

        3.1.16.10 Pinholes

        3.1.16.11 Image Properties

        3.1.16.12 Image Predicates

        3.1.16.13 Image Equality

      3.1.17 reactors

        3.1.17.1 Creating Reactors

        3.1.17.2 Configuring and Running a Reactor

          3.1.17.2.1 init

          3.1.17.2.2 on-tick

          3.1.17.2.3 seconds-per-tick

          3.1.17.2.4 to-draw

          3.1.17.2.5 on-key

          3.1.17.2.6 on-mouse

          3.1.17.2.7 stop-when

          3.1.17.2.8 close-when-stop

          3.1.17.2.9 title

        3.1.17.3 Reacting to Events Programmatically

        3.1.17.4 Tracing

      3.1.18 chart

        3.1.18.1 Creating a DataSeries

        3.1.18.2 Creating a ChartWindow

          3.1.18.2.1 Interactive Dialog

          3.1.18.2.2 Why are there watermarks on my charts?

        3.1.18.3 Chart Constructors for List Interface

        3.1.18.4 DataSeries

          3.1.18.4.1 Function Plot Series

          3.1.18.4.2 Line Plot Series

          3.1.18.4.3 Scatter Plot Series

          3.1.18.4.4 Bar Chart Series

          3.1.18.4.5 Pie Chart Series

          3.1.18.4.6 Histogram Series

        3.1.18.5 Renderers

        3.1.18.6 ChartWindow

          3.1.18.6.1 Shared Methods

          3.1.18.6.2 Plot Chart Window

          3.1.18.6.3 Bar Chart Window

          3.1.18.6.4 Multi Bar Chart Window

          3.1.18.6.5 Box Plot Chart Window

          3.1.18.6.6 Pie Chart Window

          3.1.18.6.7 Histogram Chart Window

      3.1.19 plot

        3.1.19.1 The Plot Type

        3.1.19.2 Plot Functions

        3.1.19.3 Visualization Functions

        3.1.19.4 The Options Types and Default Values

      3.1.20 statistics

        3.1.20.1 Basic Statistical Values

        3.1.20.2 Statistical Models

      3.1.21 math

        3.1.21.1 Arithmetic Functions

        3.1.21.2 Minimization & Maximization

      3.1.22 matrices

        3.1.22.1 The Vector Datatype

        3.1.22.2 Vector Methods

        3.1.22.3 Vector Functions

        3.1.22.4 The Matrix Datatype

        3.1.22.5 Matrix Constructors

        3.1.22.6 Matrix Methods

        3.1.22.7 Matrix Binary Operations

        3.1.22.8 Matrix Functions

        3.1.22.9 Matrix Conversion Functions

      3.1.23 Timing

        3.1.23.1 Background and Caveat

        3.1.23.2 Design and Rationale

        3.1.23.3 Functions

      3.1.24 fetch

    3.2 Archived Libraries

      3.2.1 image-structs

      3.2.2 world

        3.2.2.1 Starting a big-bang

        3.2.2.2 Functions

        3.2.2.3 Data Types

    3.3 Internal Libraries

      3.3.1 RawArray

        3.3.1.1 RawArray Functions

      3.3.2 data-source

        3.3.2.1 The CellContent Type

        3.3.2.2 Sanitizers

          3.3.2.2.1 Pre-defined sanitizers

      3.3.3 srcloc

        3.3.3.1 Data types

        3.3.3.2 Functions

      3.3.4 pprint

        3.3.4.1 The PPrintDoc Datatype

        3.3.4.2 PPrintDoc Methods

        3.3.4.3 Functions

      3.3.5 s-exp

      3.3.6 s-exp-structs

        3.3.6.1 The S-Exp Datatype