1. Contexts
  2. Author
  3. Requires
  4. Constructors
    1. context
    2. context-copy
  5. Conversion
    1. context->environment
    2. context->alist
    3. context->hash-table
  6. Predicates
    1. context?
    2. context-has-parent?
    3. context-ancestor?
    4. context-extensible?
    5. context-mutable?
    6. context-flag?
    7. context-empty?
    8. context-bound?
    9. context-exists?
  7. Accessors
    1. context-flags
    2. context-bindings
    3. context-size
  8. Hierarchy
    1. context-depth
    2. context-parent
    3. context-ancestors
    4. context-children
  9. Introspection
    1. context-symbols
    2. context-values
    3. context-walk
    4. context-for-each
  10. Lookup
    1. context-ref
    2. context-lookup
  11. Mutation
    1. context-set!
    2. context-remove!
    3. context-import!
    4. context-merge!
  12. Evaluation
    1. context-eval
    2. context-load
    3. context-spawn
  13. License
  14. Version History

Contexts

This egg provides evaluation contexts for building experimental Lisp<sub>1</sub> interpreters.

Author

Arto Bendiken <arto.bendiken@gmail.com>.

Requires

Constructors

context

[procedure] (context #!key [parent #f] [extensible #t] [flags] [bindings])

context-copy

[procedure] (context-copy ctx #!key [parent] [flags] [bindings] [filter #f])

Returns a new context with the same parent, flags and bindings as ctx.

Conversion

context->environment

[procedure] (context->environment ctx)

context->alist

[procedure] (context->alist ctx)

Returns an association list such that the car of each element in the result is a symbol in ctx and the corresponding cdr of each element in the result is the value associated to the binding in ctx. The order of the elements is unspecified.

context->hash-table

[procedure] (context->hash-table ctx)

Predicates

context?

[procedure] (context? x)

context-has-parent?

[procedure] (context-has-parent? ctx)

context-ancestor?

[procedure] (context-ancestor? ctx1 ctx2)

context-extensible?

[procedure] (context-extensible? ctx)

context-mutable?

[procedure] (context-mutable? ctx #!optional [symbol])

context-flag?

[procedure] (context-flag? ctx flag #!optional [default #f])

context-empty?

[procedure] (context-empty? ctx)

context-bound?

[procedure] (context-bound? ctx symbol)

context-exists?

[procedure] (context-exists? ctx symbol)

Accessors

context-flags

[procedure] (context-flags ctx)

context-bindings

[procedure] (context-bindings ctx)

context-size

[procedure] (context-size ctx)

Hierarchy

context-depth

[procedure] (context-depth ctx)

context-parent

[procedure] (context-parent ctx)

context-ancestors

[procedure] (context-ancestors ctx)

context-children

[procedure] (context-children ctx)

Introspection

context-symbols

[procedure] (context-symbols ctx #!key [sort #f])

context-values

[procedure] (context-values ctx #!key [filter #f] [unique #f])

context-walk

[procedure] (context-walk ctx proc)

context-for-each

[procedure] (context-for-each ctx proc)

Alias for context-walk.

Lookup

context-ref

[procedure] (context-ref ctx symbol #!optional [default])

context-lookup

[procedure] (context-lookup ctx symbol #!optional [default])

Mutation

context-set!

[procedure] (context-set! ctx symbol value)

context-remove!

[procedure] (context-remove! ctx symbol #!optional [silent? #f])

context-import!

[procedure] (context-import! ctx1 ctx2 #!optional [filter #f] [prefix #f])

context-merge!

[procedure] (context-merge! ctx1 ctx2 ...)

Adds all bindings in ctx2 (and any other given arguments) to ctx1 and returns the resulting context; may destructively modify ctx1.

Evaluation

context-eval

[procedure] (context-eval ctx exp)

context-load

[procedure] (context-load ctx file-or-port)

context-spawn

[procedure] (context-spawn ctx exp #!key [name] [start #t])

License

Copyright &copy; 2006-2007 Arto Bendiken.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version History