move definition of primitive base types

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

View File

@ -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

View File

@ -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

View File

@ -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))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -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))))

View File

@ -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

View File

@ -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))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -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