Skip to content

Commit f6d64c1

Browse files
lexi-lambdamfelleisen
authored andcommitted
order: Make object-name on an order return the order’s name
1 parent 0f85d3c commit f6d64c1

5 files changed

Lines changed: 13 additions & 7 deletions

File tree

data-doc/data/scribblings/order.scrbl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ than @racket[key], and the greatest key less than or equal to
101101
@racket[#f] is returned.
102102
}
103103

104-
@defproc*[([(order [name symbol?]
104+
@defproc*[([(order [name symbol?]
105105
[domain-contract contract?]
106106
[comparator (-> any/c any/c ordering/c)])
107107
(and/c order? procedure?)]
@@ -113,10 +113,11 @@ than @racket[key], and the greatest key less than or equal to
113113
(lambda (x y) (<? y x))])
114114
(and/c order? procedure?)])]{
115115

116-
Produces a named order object encapsulating a domain contract and a
116+
Produces an order object encapsulating a domain contract and a
117117
comparator function. If a single procedure is given, it is used
118118
directly as the comparator. If two or three procedures are given, they
119-
are used to construct the comparator.
119+
are used to construct the comparator. The given @racket[name] names
120+
the order object as returned by @racket[object-name].
120121

121122
The @racket[domain-contract] is not applied to the comparison
122123
function; rather, clients of the order are advised to incorporate the
@@ -134,6 +135,10 @@ comparator.
134135
(string-order "abc" "acdc")
135136
(string-order "x" 12)
136137
]
138+
139+
@history[#:changed "1.2.1" @elem{Changed the name of an order object as
140+
returned by @racket[object-name] to @racket[name] instead of
141+
@racket[(object-name comparator)].}]
137142
}
138143

139144
@defproc[(order? [x any/c]) boolean?]{

data-doc/info.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
(define pkg-desc "documentation part of \"data\"")
88

99
(define pkg-authors '(ryanc))
10-
(define build-deps '(["data-lib" #:version "1.2"]
10+
(define build-deps '(["data-lib" #:version "1.2.1"]
1111
"data-enumerate-lib"
1212
"racket-doc"
1313
"scribble-lib"

data-lib/data/order.rkt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
;; ============================================================
6969

7070
(struct order (name domain-contract comparator =? <?)
71-
#:property prop:procedure (struct-field-index comparator))
71+
#:property prop:object-name (struct-field-index name)
72+
#:property prop:procedure (struct-field-index comparator))
7273

7374
(define order*
7475
(let ([order

data-lib/info.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
(define pkg-authors '(ryanc))
99

10-
(define version "1.2")
10+
(define version "1.2.1")
1111

1212
(define license
1313
'(Apache-2.0 OR MIT))

data-test/info.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(define pkg-authors '(ryanc))
1010
(define build-deps '("data-enumerate-lib"
1111
"racket-index"
12-
["data-lib" #:version "1.2"]
12+
["data-lib" #:version "1.2.1"]
1313
"rackunit-lib"
1414
"math-lib"))
1515
(define update-implies '("data-lib"))

0 commit comments

Comments
 (0)