From 4ddd50c7e99fe9504afb3a109d757d609386736b Mon Sep 17 00:00:00 2001 From: okamsn Date: Tue, 13 Feb 2024 19:57:05 -0500 Subject: [PATCH] Make clear when we're using the `compat` function for `length>` and `length=`. --- loopy-destructure.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/loopy-destructure.el b/loopy-destructure.el index 4510f84f..976659be 100644 --- a/loopy-destructure.el +++ b/loopy-destructure.el @@ -33,7 +33,7 @@ (require 'compat) (require 'loopy-misc) (require 'loopy-instrs) -(eval-and-compile (require 'pcase)) +(require 'pcase) (require 'seq) (require 'subr-x) @@ -374,7 +374,7 @@ MAP-OR-KEY-VARS is whether there are map or key variables." (opt-len (length opt-vars))) ;; We allow the variable form to be shorter than the ;; destructured sequence. - `(and (pred (pcase--flip length> ,(1- pos-len))) + `(and (pred (pcase--flip ,(compat-function length>) ,(1- pos-len))) ,@(cl-loop for var in pos-vars for idx from 0 collect `(app (pcase--flip aref ,idx) @@ -400,8 +400,8 @@ MAP-OR-KEY-VARS is whether there are map or key variables." ;; the one variable was not supplied and we ;; need to check the remaining ones. `(and ,(if use->= - `(pred (pcase--flip length> ,(1- checked-len))) - `(pred (pcase--flip length= ,checked-len))) + `(pred (pcase--flip ,(compat-function length>) ,(1- checked-len))) + `(pred (pcase--flip ,(compat-function length=) ,checked-len))) ;; Variables that should be bound with the value in ;; the array. ,@(cl-loop @@ -449,7 +449,7 @@ MAP-OR-KEY-VARS is whether there are map or key variables." (rest-pat (loopy--get-var-pattern rest-var)) (seqsym (gensym "seqsym"))) ;; Rec-checking the length is fast for arrays. - `((or (and (pred (pcase--flip length> ,len-sum)) + `((or (and (pred (pcase--flip ,(compat-function length>) ,len-sum)) (app (pcase--flip substring ,len-sum) ; 0-indexed ,rest-pat)) (app (lambda (,seqsym) (substring ,seqsym 0 0))