Commit 60327b8 1 parent 38126cc commit 60327b8 Copy full SHA for 60327b8
File tree 4 files changed +12
-22
lines changed
4 files changed +12
-22
lines changed Original file line number Diff line number Diff line change @@ -1303,9 +1303,8 @@ value and do no affect how the loop iterates.
1303
1303
(do (message "%d" i)))
1304
1304
#+END_SRC
1305
1305
1306
- #+findex: group
1307
1306
#+findex: command-do
1308
- - =(group| command-do [CMDS])= :: Evaluate multiple loop commands, as if in a
1307
+ - =(command-do [CMDS])= :: Evaluate multiple loop commands, as if in a
1309
1308
=progn=. This is similar to =do=, but runs commands instead of normal Lisp
1310
1309
expressions. Currently, this command is only useful when used within the
1311
1310
=if= command.
@@ -1314,15 +1313,6 @@ value and do no affect how the loop iterates.
1314
1313
;; Report whether an even number is found, or return the sum of
1315
1314
;; the list's elements. To be clear, this is not an idiomatic example.
1316
1315
1317
- ;; Returns sum:
1318
- ;; => 9
1319
- (loopy (list i '(1 3 5))
1320
- (if (cl-evenp i)
1321
- (group
1322
- (do (message "Even found."))
1323
- (return i))
1324
- (sum i)))
1325
-
1326
1316
;; Returns the detected even number:
1327
1317
;; => 2
1328
1318
(loopy (list i '(1 3 2 5))
Original file line number Diff line number Diff line change @@ -265,8 +265,8 @@ This command does not wait for VAL to change before updating VAR."
265
265
(loopy--latter-body (setq , cnt (1+ , cnt )))))))))
266
266
267
267
; ;;;;; Group
268
- (cl-defun loopy--parse-group -command ((_ &rest body))
269
- " Parse the `group ' loop command.
268
+ (cl-defun loopy--parse-command-do -command ((_ &rest body))
269
+ " Parse the `command-do ' loop command.
270
270
271
271
BODY is one or more commands to be grouped by a `progn' form.
272
272
This command is suitable for using as the first sub-command in an
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ Definition must exist. Neither argument need be quoted."
77
77
(defvar loopy--obsolete-aliases
78
78
'((array across)
79
79
(array-ref arrayf arrayingf stringf stringingf across-ref)
80
+ (command-do group)
80
81
(cons on)
81
82
(list in)
82
83
(list-ref listf listingf in-ref)
@@ -179,7 +180,7 @@ true names and lists of aliases.
179
180
(array-ref . loopy--parse-array-ref-command)
180
181
(at . loopy--parse-at-command)
181
182
(collect . loopy--parse-collect-command)
182
- (command-do . loopy--parse-group -command)
183
+ (command-do . loopy--parse-command-do -command)
183
184
(concat . loopy--parse-concat-command)
184
185
(cond . loopy--parse-cond-command)
185
186
(cons . loopy--parse-cons-command)
@@ -188,7 +189,6 @@ true names and lists of aliases.
188
189
(do . loopy--parse-do-command)
189
190
(find . loopy--parse-find-command)
190
191
(set-accum . loopy--parse-set-accum-command)
191
- (group . loopy--parse-group-command)
192
192
(if . loopy--parse-if-command)
193
193
(iter . loopy--parse-iter-command)
194
194
(leave . loopy--parse-leave-command)
Original file line number Diff line number Diff line change @@ -844,20 +844,20 @@ SYMS-STR are the string names of symbols from `loopy-iter-bare-commands'."
844
844
:iter-bare ((set . setting)
845
845
(return . returning)))
846
846
847
- ;;;;; Group
848
- (loopy-deftest group
847
+ ;;;;; command-do
848
+ (loopy-deftest command-do
849
849
:result '((2 4 6) (2 4 6))
850
850
:body ((list i '(1 2 3 4 5 6))
851
851
(if (cl-evenp i)
852
- (_group (collect c1 i)
853
- (collect c2 i)))
852
+ (_command-do (collect c1 i)
853
+ (collect c2 i)))
854
854
(finally-return c1 c2))
855
- :repeat _group
856
- :loopy ((_group . (group command-do)))
855
+ :repeat _command-do
856
+ :loopy ((_command-do . (command-do command-do)))
857
857
;; Technically don't need to test (and wouldn't work if we used `for' inside,
858
858
;; anyway).
859
859
:iter-keyword ((list . list)
860
- (_group . (group command-do))))
860
+ (_command-do . (command-do command-do))))
861
861
862
862
;;;;; Set-Prev
863
863
(loopy-deftest set-prev
You can’t perform that action at this time.
0 commit comments