From: admin Date: Mon, 6 Nov 2023 02:42:54 +0000 (+0900) Subject: Take instead of reverse drop X-Git-Tag: v0.2.0~18 X-Git-Url: https://git.vouivredigital.com/?a=commitdiff_plain;h=505513b2e27bdd95f693fab8eb941699045cf0ab;p=vouivre.git Take instead of reverse drop --- diff --git a/grad.scm b/grad.scm index 315f4c0..5e1ea7f 100644 --- a/grad.scm +++ b/grad.scm @@ -30,9 +30,9 @@ (if (or (> n (array-rank a)) (> n (array-rank b))) (error "can't contract arrays with size lower than" n) - (append (reverse (drop (reverse dims-a) - n)) - (drop dims-b n))))) + (append (take dims-a (- (array-rank a) + n)) + (drop dims-b n))))) (define (contract-arrays a b n) (let* ((dims (contracted-dims a b n))