loops without subloops can now use :for clauses in final-expr
This commit is contained in:
parent
9988434554
commit
e057a6b8fe
3 changed files with 17 additions and 5 deletions
8
CHANGELOG
Normal file
8
CHANGELOG
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
v0.2 [unreleased]
|
||||||
|
- Made clauses execute in lexical order
|
||||||
|
- Loops without subloops can use :for clauses in the final expression.
|
||||||
|
- :final also obeys lexical order, and everything below it will run once
|
||||||
|
any subloop will run to exhaustion.
|
||||||
|
|
||||||
|
|
||||||
|
v.0.1 First release
|
|
@ -298,7 +298,7 @@ $3 = (let loopy-loop ((cursor (read)))
|
||||||
This used to be a pretty vast collection of examples. goof-loof is now different enough from foof loop that you can't expect to carry your foof-loop skills over to goof-loop. There are however two notable regressions.
|
This used to be a pretty vast collection of examples. goof-loof is now different enough from foof loop that you can't expect to carry your foof-loop skills over to goof-loop. There are however two notable regressions.
|
||||||
|
|
||||||
### Regressions compared to foof-loop
|
### Regressions compared to foof-loop
|
||||||
only accumulating clauses are visible in the final-expression. This is due to sequence clauses not being promoted through to outer loops (since they should not keep their state if an inner loop is exited).
|
only accumulating clauses are guaranteed to be visible in the final-expression. This is due to sequence clauses not being promoted through to outer loops (since they should not keep their state if an inner loop is exited).
|
||||||
|
|
||||||
Due to clause reordering, positional updates are not supported. If you want to update your loop vars, do so using named update (see below).
|
Due to clause reordering, positional updates are not supported. If you want to update your loop vars, do so using named update (see below).
|
||||||
|
|
||||||
|
|
|
@ -306,15 +306,19 @@
|
||||||
(((ff-cur ...) (ff-above ...)))
|
(((ff-cur ...) (ff-above ...)))
|
||||||
((us ...))
|
((us ...))
|
||||||
final-expr . body)
|
final-expr . body)
|
||||||
(let* ((final-fun (lambda (final-binding ...) final-expr))
|
(let* (lets ...)
|
||||||
lets ...)
|
|
||||||
(let loop ((accvar accinit) ... (var init) ...)
|
(let loop ((accvar accinit) ... (var init) ...)
|
||||||
(if (or checks ...)
|
(if (or checks ...)
|
||||||
(begin
|
(begin
|
||||||
|
ff-above ...
|
||||||
ff-cur ...
|
ff-cur ...
|
||||||
(final-fun final-value ...))
|
(let ((final-binding final-value) ...)
|
||||||
|
final-expr))
|
||||||
(ref-let (refs ...)
|
(ref-let (refs ...)
|
||||||
(user (ff-above ... ff-cur ... (final-fun final-value ...))
|
(user (ff-above ...
|
||||||
|
ff-cur ...
|
||||||
|
(let ((final-binding final-value) ...)
|
||||||
|
final-expr))
|
||||||
(loop accvar ... step ...)
|
(loop accvar ... step ...)
|
||||||
#f
|
#f
|
||||||
(us ...)
|
(us ...)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue