Prefab structs for everything
This commit is contained in:
parent
f59080e6bf
commit
67dba5444b
|
@ -38,13 +38,13 @@
|
|||
(define main-mark-type (mark-type "main" 'right))
|
||||
|
||||
(struct buffergroup ([members #:mutable] ;; (CircularList Buffer)
|
||||
) #:transparent)
|
||||
) #:prefab)
|
||||
|
||||
(struct buffer ([rope #:mutable]
|
||||
[pos #:mutable]
|
||||
[title #:mutable]
|
||||
[group #:mutable] ;; (Option BufferGroup)
|
||||
) #:transparent)
|
||||
) #:prefab)
|
||||
|
||||
(define (make-buffergroup)
|
||||
(buffergroup circular-empty))
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
(item xs)]
|
||||
(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 ys-equivalence-classes (equivalence-classes ys))
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
[background-color #:mutable] ;; Nat
|
||||
[bold? #:mutable] ;; Boolean
|
||||
[italic? #:mutable] ;; Boolean
|
||||
) #:transparent)
|
||||
) #:prefab)
|
||||
|
||||
(define (tty-last-row t) (- (tty-rows t) 1))
|
||||
(define (tty-last-column t) (- (tty-columns t) 1))
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
(struct editor (buffers ;; BufferGroup
|
||||
[windows #:mutable] ;; (List (List Window SizeSpec)), abstract window layout
|
||||
[active-window #:mutable] ;; (Option Window)
|
||||
) #:transparent)
|
||||
) #:prefab)
|
||||
|
||||
(define (make-editor)
|
||||
(define g (make-buffergroup))
|
||||
|
|
|
@ -50,11 +50,11 @@
|
|||
|
||||
;; A MarkType is a (mark-type String Stickiness). MarkTypes can be
|
||||
;; 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
|
||||
;; 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.
|
||||
;; #f is the empty Rope; otherwise a (rope) struct instance.
|
||||
|
@ -65,7 +65,7 @@
|
|||
size* ;; Number, total length of this rope
|
||||
marks* ;; (Seteq MarkType)
|
||||
mark-index ;; (Hasheq MarkType (Hash Number (Set Any))), marks in this span
|
||||
) #:transparent)
|
||||
) #:prefab)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Strands
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
(struct window (id ;; Symbol
|
||||
[buffer #:mutable] ;; Buffer
|
||||
) #:transparent)
|
||||
) #:prefab)
|
||||
|
||||
(define (make-window initial-buffer)
|
||||
(window (gensym 'window)
|
||||
|
|
Loading…
Reference in New Issue