utils: Add Variable and VariableMapping.
This commit is contained in:
parent
33ddd747c3
commit
4490cadf58
2 changed files with 17 additions and 3 deletions
|
@ -17,6 +17,21 @@ the package: evaluating sexps, manipulating lists,
|
||||||
[sandbox-memory-limit 50])
|
[sandbox-memory-limit 50])
|
||||||
(make-evaluator 'racket/base #:requires '("utils.rkt"))))
|
(make-evaluator 'racket/base #:requires '("utils.rkt"))))
|
||||||
|
|
||||||
|
@section{Base types}
|
||||||
|
|
||||||
|
@defidform[Variable]{
|
||||||
|
|
||||||
|
Any Racket symbol. Designates a variable in a discrete dynamical network.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@defform[(VariableMapping A)]{
|
||||||
|
|
||||||
|
An immutable mapping (a hash table) assigning elements of type @racket[A] to
|
||||||
|
the variables.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@section{Hashtable injection}
|
@section{Hashtable injection}
|
||||||
|
|
||||||
This section defines some utilities to streamline the usage of hash tables
|
This section defines some utilities to streamline the usage of hash tables
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
(for-syntax syntax/parse racket/list))
|
(for-syntax syntax/parse racket/list))
|
||||||
(provide (all-defined-out))
|
(provide (all-defined-out))
|
||||||
|
|
||||||
(define a 1))
|
(define-type Variable Symbol)
|
||||||
|
(define-type (VariableMapping A) (Immutable-HashTable Variable A)))
|
||||||
|
|
||||||
(require 'typed)
|
(require 'typed)
|
||||||
|
|
||||||
(displayln a)
|
|
||||||
|
|
||||||
;;; Untyped section.
|
;;; Untyped section.
|
||||||
|
|
||||||
(provide
|
(provide
|
||||||
|
|
Loading…
Reference in a new issue