move definition of primitive base types

This commit is contained in:
Sam Caldwell 2019-05-09 10:23:15 -04:00
parent 97b3a9a0b5
commit 1bdb9b7820
7 changed files with 22 additions and 4 deletions

View File

@ -207,7 +207,7 @@
(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)
((current-type-eval) t))
@ -262,7 +262,18 @@
#'(~→ ty-in ... (~Computation (~Value ty-out)
(~Endpoints)
(~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"
(begin-for-syntax

View File

@ -19,6 +19,7 @@
(require "core-types.rkt")
(require (only-in "list.rkt" List))
(require (only-in "prim.rkt" Int Bool))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Immutable Hash Tables

View File

@ -11,6 +11,7 @@
reverse)
(require "core-types.rkt")
(require (only-in "prim.rkt" Bool))
(require (postfix-in - racket/list))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -11,6 +11,8 @@
;; Primitives
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-base-types Int Bool String ByteString Symbol)
;; hmmm
(define-primop + ( Int Int (Computation (Value Int) (Endpoints) (Roles) (Spawns))))
(define-primop - ( Int Int (Computation (Value Int) (Endpoints) (Roles) (Spawns))))

View File

@ -8,7 +8,7 @@
;; Start dataspace programs
run-ground-dataspace
;; Types
Int Bool String Tuple Bind Discard ByteString Symbol
Tuple Bind Discard
Role Reacts Shares Know ¬Know Message OnDataflow Stop OnStart OnStop
FacetName Field ★/t
Observe Inbound Outbound Actor U

View File

@ -22,6 +22,7 @@
(require "core-types.rkt")
(require (only-in "list.rkt" List))
(require (only-in "set.rkt" Set))
(require (only-in "prim.rkt" Int Bool))
#;(require (postfix-in - racket/sequence))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -14,13 +14,15 @@
set->list)
(require "core-types.rkt")
(require (only-in "prim.rkt" Int))
(require (only-in "list.rkt" ~List))
(require (postfix-in - racket/set))
(module+ test
(require rackunit)
(require rackunit/turnstile))
(require rackunit/turnstile)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Sets