Skip to content

Commit 60f8683

Browse files
committed
Fix #1372
1 parent 235c62d commit 60f8683

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/core/mainloop.rkt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,6 @@
165165

166166
;; Converts a patch to full alt with valid history
167167
(define (reconstruct! alts)
168-
;; extracts the base expressions of a patch as a batchref
169-
(define (get-starting-expr altn)
170-
(match (alt-prevs altn)
171-
[(list) (alt-expr altn)]
172-
[(list prev) (get-starting-expr prev)]))
173-
174168
;; takes a patch and converts it to a full alt
175169
(define (reconstruct-alt altn loc0 orig)
176170
(let loop ([altn altn])

src/core/patch.rkt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"rival.rkt"
1616
"taylor.rkt")
1717

18-
(provide generate-candidates)
18+
(provide generate-candidates get-starting-expr)
1919

2020
;;;;;;;;;;;;;;;;;;;;;;;;;;;; Taylor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2121

@@ -195,6 +195,11 @@
195195

196196
;;;;;;;;;;;;;;;;;;;;;;;;;;;; Public API ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
197197

198+
(define (get-starting-expr altn)
199+
(match (alt-prevs altn)
200+
[(list) (alt-expr altn)]
201+
[(list prev) (get-starting-expr prev)]))
202+
198203
(define (generate-candidates batch brfs spec-batch reducer)
199204
; Starting alternatives
200205
(define start-altns
@@ -218,4 +223,5 @@
218223
(run-rr start-altns batch)
219224
'()))
220225

221-
(remove-duplicates (append evaluations rewritten approximations) #:key alt-expr))
226+
(remove-duplicates (append evaluations rewritten approximations)
227+
#:key (λ (altn) (cons (alt-expr altn) (get-starting-expr altn)))))

0 commit comments

Comments
 (0)