move definition of primitive base types
This commit is contained in:
parent
b1cca8f377
commit
f00ec81e48
|
@ -207,7 +207,7 @@
|
||||||
(define-type-constructor Spawns #:arity >= 0)
|
(define-type-constructor Spawns #:arity >= 0)
|
||||||
|
|
||||||
|
|
||||||
(define-base-types Int Bool String Discard ★/t FacetName ByteString Symbol)
|
(define-base-types Discard ★/t FacetName)
|
||||||
|
|
||||||
(define-for-syntax (type-eval t)
|
(define-for-syntax (type-eval t)
|
||||||
((current-type-eval) t))
|
((current-type-eval) t))
|
||||||
|
@ -262,7 +262,18 @@
|
||||||
#'(~→ ty-in ... (~Computation (~Value ty-out)
|
#'(~→ ty-in ... (~Computation (~Value ty-out)
|
||||||
(~Endpoints)
|
(~Endpoints)
|
||||||
(~Roles)
|
(~Roles)
|
||||||
(~Spawns)))]))))
|
(~Spawns)))])))
|
||||||
|
|
||||||
|
;; matching possibly polymorphic types
|
||||||
|
(define-syntax ~?∀
|
||||||
|
(pattern-expander
|
||||||
|
(lambda (stx)
|
||||||
|
(syntax-case stx ()
|
||||||
|
[(?∀ vars-pat body-pat)
|
||||||
|
#'(~or (~∀ vars-pat body-pat)
|
||||||
|
(~and (~not (~∀ _ _))
|
||||||
|
(~parse vars-pat #'())
|
||||||
|
body-pat))])))))
|
||||||
|
|
||||||
;; for looking at the "effects"
|
;; for looking at the "effects"
|
||||||
(begin-for-syntax
|
(begin-for-syntax
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
(require "core-types.rkt")
|
(require "core-types.rkt")
|
||||||
(require (only-in "list.rkt" List))
|
(require (only-in "list.rkt" List))
|
||||||
|
(require (only-in "prim.rkt" Int Bool))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Immutable Hash Tables
|
;; Immutable Hash Tables
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
reverse)
|
reverse)
|
||||||
|
|
||||||
(require "core-types.rkt")
|
(require "core-types.rkt")
|
||||||
|
(require (only-in "prim.rkt" Bool))
|
||||||
(require (postfix-in - racket/list))
|
(require (postfix-in - racket/list))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
;; Primitives
|
;; Primitives
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(define-base-types Int Bool String ByteString Symbol)
|
||||||
|
|
||||||
;; hmmm
|
;; hmmm
|
||||||
(define-primop + (→ Int Int (Computation (Value Int) (Endpoints) (Roles) (Spawns))))
|
(define-primop + (→ Int Int (Computation (Value Int) (Endpoints) (Roles) (Spawns))))
|
||||||
(define-primop - (→ Int Int (Computation (Value Int) (Endpoints) (Roles) (Spawns))))
|
(define-primop - (→ Int Int (Computation (Value Int) (Endpoints) (Roles) (Spawns))))
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
;; Start dataspace programs
|
;; Start dataspace programs
|
||||||
run-ground-dataspace
|
run-ground-dataspace
|
||||||
;; Types
|
;; Types
|
||||||
Int Bool String Tuple Bind Discard → ∀ ByteString Symbol
|
Tuple Bind Discard → ∀
|
||||||
Role Reacts Shares Know ¬Know Message OnDataflow Stop OnStart OnStop
|
Role Reacts Shares Know ¬Know Message OnDataflow Stop OnStart OnStop
|
||||||
FacetName Field ★/t
|
FacetName Field ★/t
|
||||||
Observe Inbound Outbound Actor U
|
Observe Inbound Outbound Actor U
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
(require "core-types.rkt")
|
(require "core-types.rkt")
|
||||||
(require (only-in "list.rkt" List))
|
(require (only-in "list.rkt" List))
|
||||||
(require (only-in "set.rkt" Set))
|
(require (only-in "set.rkt" Set))
|
||||||
|
(require (only-in "prim.rkt" Int Bool))
|
||||||
#;(require (postfix-in - racket/sequence))
|
#;(require (postfix-in - racket/sequence))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
|
@ -14,13 +14,15 @@
|
||||||
set->list)
|
set->list)
|
||||||
|
|
||||||
(require "core-types.rkt")
|
(require "core-types.rkt")
|
||||||
|
(require (only-in "prim.rkt" Int))
|
||||||
(require (only-in "list.rkt" ~List))
|
(require (only-in "list.rkt" ~List))
|
||||||
|
|
||||||
(require (postfix-in - racket/set))
|
(require (postfix-in - racket/set))
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(require rackunit)
|
(require rackunit)
|
||||||
(require rackunit/turnstile))
|
(require rackunit/turnstile)
|
||||||
|
)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Sets
|
;; Sets
|
||||||
|
|
Loading…
Reference in New Issue