@@ -191,9 +191,10 @@ are floored and truncated division, respectively."
191
191
(lisp , type (a n) (cl :rem a n)))
192
192
(inline )
193
193
(define (quotRem a n)
194
- (lisp (Tuple , type , type) (a n)
195
- (cl :multiple-value-bind (q r) (cl :truncate a n)
196
- (Tuple (coalton (the , type (fromInt (lisp Integer () q)))) r))))
194
+ (match (lisp (Tuple Integer , type) (a n)
195
+ (cl :multiple-value-call ' Tuple (cl :truncate a n)))
196
+ ((Tuple q r)
197
+ (Tuple (fromInt q) r))))
197
198
(inline )
198
199
(define (div a n)
199
200
(fromInt (lisp Integer (a n) (cl :floor a n))))
@@ -202,9 +203,10 @@ are floored and truncated division, respectively."
202
203
(lisp , type (a n) (cl :mod a n)))
203
204
(inline )
204
205
(define (divMod a n)
205
- (lisp (Tuple , type , type) (a n)
206
- (cl :multiple-value-bind (d m) (cl :floor a n)
207
- (Tuple (coalton (the , type (fromInt (lisp Integer () d)))) m)))))))
206
+ (match (lisp (Tuple Integer , type) (a n)
207
+ (cl :multiple-value-call ' Tuple (cl :floor a n)))
208
+ ((Tuple d m)
209
+ (Tuple (fromInt d) m)))))))
208
210
209
211
(cl :defmacro %define-integral-native (type signed)
210
212
(cl :let ((even? (cl :intern (cl :concatenate ' cl:string (cl :symbol-name type ) " -EVEN?" )))
0 commit comments