File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 439439 ([entry (in-list json)])
440440 (match-define (list pt ex) entry)
441441 (unless (and (list? pt) (= (length pt) (length var-reprs)))
442- (error 'json->pcontext "Invalid point ~a " pt))
442+ (raise-arguments- error 'json->pcontext "Invalid point " " pt " pt))
443443 (values (list->vector (map json->value pt var-reprs)) (json->value ex output-repr))))
444444 (mk-pcontext pts exs))
445445
Original file line number Diff line number Diff line change 167167 (match command
168168 ['improve
169169 (job-result command test 'timeout (*timeout*) (timeline-extract) #f (warning-log) #f )]
170- [_ (error 'run-herbie "command ~a timed out " command)])))
170+ [_ (raise-arguments- error 'run-herbie "command timed out " " command " command)])))
171171
172172 (define (compute-result)
173173 (parameterize ([*timeline-disabled* (not timeline?)])
189189 ['improve (get-alternatives test (get-sample test))]
190190 ['local-error (get-local-error test pcontext)]
191191 ['sample (get-sample test)]
192- [_ (error 'compute-result "unknown command ~a " command)]))
192+ [_ (raise-arguments- error 'compute-result "unknown command " " command " command)]))
193193 (timeline-event! 'end )
194194 (define time (- (current-inexact-milliseconds) start-time))
195195 (job-result command test 'success time (timeline-extract) #f (warning-log) result))))
Original file line number Diff line number Diff line change 220220 (cons exact-pow
221221 (for/list ([term (cdr terms)])
222222 (cons (* a (car term)) (cdr term))))
223- (cons 1
224- (list* (cons a (batch-push! batch (car terms)))
225- (for/list ([term (cdr terms)])
226- (cons (* a (car term)) (cdr term) )))))]
223+ (list* 1
224+ (cons a (batch-push! batch (car terms)))
225+ (for/list ([term (cdr terms)])
226+ (cons (* a (car term)) (cdr term)))))]
227227 [_ `(1 . ((1 . ,brf)))]))
228228 (batch-recurse batch gather-multiplicative-terms))
229229
230230(define (combine-aterms terms)
231231 (define h (make-hash))
232232 (for ([term terms])
233- (define sum (hash-ref! h (cadr term) 0 ))
234- (hash-set! h (cadr term) (+ (car term) sum)))
233+ (hash-update! h (cadr term) (λ (sum) (+ (car term) sum)) 0 ))
235234 (sort (reap [sow]
236235 (for ([(k v) (in-hash h)]
237236 #:when (not (= v 0 )))
243242 (cons (car terms)
244243 (let ([h (make-hash)])
245244 (for ([term (cdr terms)])
246- (define sum (hash-ref! h (cdr term) 0 ))
247- (hash-set! h (cdr term) (+ (car term) sum)))
245+ (hash-update! h (cdr term) (λ (sum) (+ (car term) sum)) 0 ))
248246 (sort (reap [sow]
249247 (for ([(k v) (in-hash h)]
250248 #:unless (= v 0 ))
You can’t perform that action at this time.
0 commit comments