2.1 Language Constructs

This section contains information on the various language forms in Pyret, from binary operators to data definitions to functions. This is a more detailed reference to the grammar of expressions and statements and their evaluation, rather than to

    2.1.1 Primitives and Literals Names String Literals Number Literals Boolean Literals


    2.1.3 Programs

    2.1.4 Import Statements

    2.1.5 Provide Statements

    2.1.6 Bindings Name bindings Annotated bindings Shadowing Tuple bindings

    2.1.7 Blocks Block Shorthand

    2.1.8 Declarations Let Declarations Recursive Let Declarations Function Declaration Expressions Scope Where blocks Syntactic sugar Data Declarations Variable Declarations Type Declarations Newtype Declarations

    2.1.9 Contracts

    2.1.10 Statements When Statements Assignment Statements Binop Expression “Statements”

    2.1.11 Expressions Lambda Expressions Curly-Brace Lambda Shorthand Anonymous Method Expressions Application Expressions Curried Application Expressions Chaining Application Instantiation Expressions Binary Operators Tuple Expressions Tuple Access Expressions Object Expressions Dot Expressions Extend Expressions If Expressions Ask Expressions Cases Expressions For Expressions Template (...) Expressions Tables Sorting Table Rows Transforming Table Rows Extracting Table Columns Adding Table Columns Table Loading Expressions Reactor Expressions Mutable fields Construction expressions Expression forms of bindings

    2.1.12 Annotations Name Annotations Parametric Annotations Arrow Annotations Predicate Annotations Tuple Annotations Record Annotations