3 Builtins and Libraries

This section contains information on libraries that come with Pyret.

    3.1 Global Utilities

      3.1.1 Built-in Utility Functions

      3.1.2 Built-in Types

      3.1.3 Type Predicates

    3.2 Numbers

      3.2.1 Number Annotations

      3.2.2 Number Literals

      3.2.3 Number Constants

      3.2.4 Number Functions

      3.2.5 Random Numbers

      3.2.6 Other Number Functions

    3.3 Strings

      3.3.1 String Functions

    3.4 Booleans

      3.4.1 Boolean Functions

    3.5 RawArray

      3.5.1 RawArray Functions

    3.6 Tables

      3.6.1 Creating Tables

      3.6.2 Loading Tables

      3.6.3 Selecting Columns

      3.6.4 Filtering Tables

      3.6.5 Ordering Tables

      3.6.6 Transforming Tables

      3.6.7 Extracting Columns from Tables

      3.6.8 Extending Tables

        3.6.8.1 Mapping extensions

        3.6.8.2 Reducers

      3.6.9 Comparing Tables

      3.6.10 Advanced Table Manipulation

    3.7 lists

      3.7.1 The List Datatype

      3.7.2 The list Constructor

      3.7.3 List Methods

      3.7.4 List Functions

    3.8 sets

      3.8.1 The Set Type

      3.8.2 Set Constructors

      3.8.3 Set Methods

    3.9 arrays

      3.9.1 Array Creation Functions

      3.9.2 Array Methods

      3.9.3 Array Functions

    3.10 string-dict

      3.10.1 The StringDict Type

      3.10.2 StringDict Constructor

      3.10.3 StringDict Methods

      3.10.4 The MutableStringDict Type

      3.10.5 MutableStringDict Constructor

      3.10.6 MutableStringDict Methods

    3.11 option

      3.11.1 The Option Datatype

      3.11.2 Option Methods

    3.12 pick

      3.12.1 The Pick Datatype

    3.13 either

      3.13.1 Data types

    3.14 srcloc

      3.14.1 Data types

      3.14.2 Functions

    3.15 pprint

      3.15.1 The PPrintDoc Datatype

      3.15.2 PPrintDoc Methods

      3.15.3 Functions

    3.16 s-exp

    3.17 s-exp-structs

      3.17.1 The S-Exp Datatype

    3.18 color

      3.18.1 Data types

      3.18.2 Predefined colors

    3.19 image-structs

    3.20 The image libraries

      3.20.1 Data Types

      3.20.2 Basic Images

        3.20.2.1 Data types for drawing basic images

      3.20.3 Text

        3.20.3.1 Data types for text images

      3.20.4 Polygons

      3.20.5 Other images

      3.20.6 Overlaying Images

        3.20.6.1 Data types for aligning images

      3.20.7 Placing Images & Scenes

      3.20.8 Rotating, Scaling, Flipping, Cropping and Framing Images

      3.20.9 Bitmaps

      3.20.10 Pinholes

      3.20.11 Image Properties

      3.20.12 Image Predicates

      3.20.13 Image Equality

    3.21 world

      3.21.1 Starting a big-bang

      3.21.2 Functions

      3.21.3 Data Types

    3.22 gdrive-sheets

      3.22.1 The Spreadsheet Type

      3.22.2 The Worksheet Type

      3.22.3 Spreadsheet Functions

      3.22.4 Spreadsheet Methods

    3.23 data-source

      3.23.1 The CellContent Type

      3.23.2 Sanitizers

        3.23.2.1 Pre-defined sanitizers

    3.24 reactors

      3.24.1 Creating Reactors

      3.24.2 Configuring and Running a Reactor

        3.24.2.1 init

        3.24.2.2 on-tick

        3.24.2.3 seconds-per-tick

        3.24.2.4 to-draw

        3.24.2.5 on-key

        3.24.2.6 on-mouse

        3.24.2.7 stop-when

        3.24.2.8 close-when-stop

        3.24.2.9 title

      3.24.3 Reacting to Events Programmatically

      3.24.4 Tracing

    3.25 chart

      3.25.1 Creating a DataSeries

      3.25.2 Creating a ChartWindow

        3.25.2.1 Interactive Dialog

        3.25.2.2 Why are there watermarks on my charts?

      3.25.3 Chart Constructors for List Interface

      3.25.4 DataSeries

        3.25.4.1 Function Plot Series

        3.25.4.2 Line Plot Series

        3.25.4.3 Scatter Plot Series

        3.25.4.4 Bar Chart Series

        3.25.4.5 Pie Chart Series

        3.25.4.6 Histogram Series

      3.25.5 Renderers

      3.25.6 ChartWindow

        3.25.6.1 Shared Methods

        3.25.6.2 Plot Chart Window

        3.25.6.3 Bar Chart Window

        3.25.6.4 Multi Bar Chart Window

        3.25.6.5 Box Plot Chart Window

        3.25.6.6 Pie Chart Window

        3.25.6.7 Histogram Chart Window

    3.26 plot

      3.26.1 The Plot Type

      3.26.2 Plot Functions

      3.26.3 Visualization Functions

      3.26.4 The Options Types and Default Values

    3.27 statistics

      3.27.1 Basic Statistical Values

      3.27.2 Statistical Models

    3.28 math

      3.28.1 Arithmetic Functions

      3.28.2 Minimization & Maximization