Prefab structs for everything

This commit is contained in:
Tony Garnock-Jones 2014-12-22 17:17:05 -05:00
parent f59080e6bf
commit 67dba5444b
6 changed files with 9 additions and 9 deletions

View File

@ -38,13 +38,13 @@
(define main-mark-type (mark-type "main" 'right)) (define main-mark-type (mark-type "main" 'right))
(struct buffergroup ([members #:mutable] ;; (CircularList Buffer) (struct buffergroup ([members #:mutable] ;; (CircularList Buffer)
) #:transparent) ) #:prefab)
(struct buffer ([rope #:mutable] (struct buffer ([rope #:mutable]
[pos #:mutable] [pos #:mutable]
[title #:mutable] [title #:mutable]
[group #:mutable] ;; (Option BufferGroup) [group #:mutable] ;; (Option BufferGroup)
) #:transparent) ) #:prefab)
(define (make-buffergroup) (define (make-buffergroup)
(buffergroup circular-empty)) (buffergroup circular-empty))

View File

@ -14,7 +14,7 @@
(item xs)] (item xs)]
(hash-set classes item (set-add (hash-ref classes item (lambda () (set))) i)))) (hash-set classes item (set-add (hash-ref classes item (lambda () (set))) i))))
(struct candidate (x-index y-index chain) #:transparent) (struct candidate (x-index y-index chain) #:prefab)
(define (longest-common-subsequence xs ys) (define (longest-common-subsequence xs ys)
(define ys-equivalence-classes (equivalence-classes ys)) (define ys-equivalence-classes (equivalence-classes ys))

View File

@ -37,7 +37,7 @@
[background-color #:mutable] ;; Nat [background-color #:mutable] ;; Nat
[bold? #:mutable] ;; Boolean [bold? #:mutable] ;; Boolean
[italic? #:mutable] ;; Boolean [italic? #:mutable] ;; Boolean
) #:transparent) ) #:prefab)
(define (tty-last-row t) (- (tty-rows t) 1)) (define (tty-last-row t) (- (tty-rows t) 1))
(define (tty-last-column t) (- (tty-columns t) 1)) (define (tty-last-column t) (- (tty-columns t) 1))

View File

@ -14,7 +14,7 @@
(struct editor (buffers ;; BufferGroup (struct editor (buffers ;; BufferGroup
[windows #:mutable] ;; (List (List Window SizeSpec)), abstract window layout [windows #:mutable] ;; (List (List Window SizeSpec)), abstract window layout
[active-window #:mutable] ;; (Option Window) [active-window #:mutable] ;; (Option Window)
) #:transparent) ) #:prefab)
(define (make-editor) (define (make-editor)
(define g (make-buffergroup)) (define g (make-buffergroup))

View File

@ -50,11 +50,11 @@
;; A MarkType is a (mark-type String Stickiness). MarkTypes can be ;; A MarkType is a (mark-type String Stickiness). MarkTypes can be
;; associated with a set of Any values at each position in the rope. ;; associated with a set of Any values at each position in the rope.
(struct mark-type (name stickiness) #:transparent) (struct mark-type (name stickiness) #:prefab)
;; A Strand is a (strand String Number Number), representing a ;; A Strand is a (strand String Number Number), representing a
;; substring of a string. ;; substring of a string.
(struct strand (text offset count) #:transparent) (struct strand (text offset count) #:prefab)
;; A Rope is a splay tree representing a long piece of text. ;; A Rope is a splay tree representing a long piece of text.
;; #f is the empty Rope; otherwise a (rope) struct instance. ;; #f is the empty Rope; otherwise a (rope) struct instance.
@ -65,7 +65,7 @@
size* ;; Number, total length of this rope size* ;; Number, total length of this rope
marks* ;; (Seteq MarkType) marks* ;; (Seteq MarkType)
mark-index ;; (Hasheq MarkType (Hash Number (Set Any))), marks in this span mark-index ;; (Hasheq MarkType (Hash Number (Set Any))), marks in this span
) #:transparent) ) #:prefab)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Strands ;; Strands

View File

@ -20,7 +20,7 @@
(struct window (id ;; Symbol (struct window (id ;; Symbol
[buffer #:mutable] ;; Buffer [buffer #:mutable] ;; Buffer
) #:transparent) ) #:prefab)
(define (make-window initial-buffer) (define (make-window initial-buffer)
(window (gensym 'window) (window (gensym 'window)