#11 ✓resolved
Douglas Creager

Staticly scoped environments

Reported by Douglas Creager | August 25th, 2008 @ 07:14 PM

Identifier references in CSPM are staticly scoped. Before implementing let bindings, λ abstractions, and variable references, I'll have to create an implementation of staticly scoped environments.

Comments and changes to this ticket

  • Douglas Creager

    Douglas Creager September 2nd, 2008 @ 07:10 PM

    (from [2a3f31e387e7b41c1856ff79a47ad5bfebdea5cc]) CSPM environments

    An environment is the symbol table that hold CSPM definitions. They provide a standard mapping between identifiers and the expressions that define them. Environments can also have an optional parent, which allows nested scoping; if an identifier is not found in the current environment, we then proceed to look for it in the containing environment.

    This patch introduces the basic API for creating and using environments, but does not extend the evaluation rules to use them.

    Lighthouse: [#11] http://github.com/dcreager/hst/c...

  • Douglas Creager

    Douglas Creager September 2nd, 2008 @ 07:11 PM

    (from [37739ef6e867fa53cb039c707bf15d4e1affd1ba]) Flattening the Expression type

    Before, we had separate datatypes for each “class” of expression; for instance, a Number type for any expression that always evaluates to a number. The Expression type was then defined as a sum type across all of these subtypes.

    This patch flattens things so that there's only a single Expression type. This simplifies things by removing a level of indirection in the type definitions, and also will make it easier to define “bound expressions” as we implement static-scoped environments.

    Lighthouse: [#11] http://github.com/dcreager/hst/c...

  • Douglas Creager

    Douglas Creager September 2nd, 2008 @ 07:11 PM

    (from [260a78539f5808c2553f028caf28fc47e57ddb0c]) Let bindings

    This patch introduces evaluation rules for let bindings and variable references. Currently, this is the only way to define the value for a variable.

    Lighthouse: [#11] http://github.com/dcreager/hst/c...

  • Douglas Creager

    Douglas Creager September 2nd, 2008 @ 07:12 PM

    • State changed from “new” to “resolved”

    (from [5767f91d2daf37310ef12fbfd1c7f0617780cc46]) Evaluation rules for lambdas

    This patch introduces lambdas and application statements. This requires carrying around bound expressions as regular expressions, since the actual parameters to an application are already bound, but we need to add those actual parameters to the environment created for evaluating the lambda body.

    Lighthouse: [#11 state:resolved] http://github.com/dcreager/hst/c...

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

An open-source refinement checker for the CSP process algebra.

People watching this ticket

Tags

Referenced by

Pages