1 * ChangeLog and NEWS files
3 * Replace :use in packages with explicit imports
4 * ASDF3 test-op and best practices for system definitions
5 * Fix BREAKing out of LOOP
6 https://github.com/vsedach/Parenscript/issues/43
12 collect (loop for t3 in t2 collect t3))))
16 function foo(t1, t5) {
19 var _js54 = t1.length;
20 var _js56 = t5.length;
23 for (var _js53 = 0; _js53 < _js54; _js53 += 1) {
26 var _js55 = FIRST58 ? 0 : _js55 + 1;
31 collect57.push((function () {
32 var _js60 = t2.length;
34 for (var _js59 = 0; _js59 < _js60; _js59 += 1) {
42 return FIRST58 = null;
50 Note that the entire outer-loop body is inside a js function but it still contains break statements.
52 Reverting e6489e0 fixes this issue.
54 This is reduced from a regression in real-world code.
57 jasom commented on Jan 11
59 As ECMA script 6 supports block scoping via "let" the only way I see of implementing this would be to wrap the loop in a try and change the break to be a throw. Or we could just not support strict mode and go back to using with (which provides the scoping).
62 jasom commented on Jan 11 •
64 Actually for this example "break" could be turned into "return" since the entire loop body is a function.
66 The above doesn't terminate the loop; rather the loop would have to be inside the function and then break could just be used anyways. My comment below is still true.
68 I don't know enough about the loop implementation to say if this works for the general case.
71 vsedach commented on Jan 11
72 As ECMA script 6 supports block scoping via "let" the only way I
73 see of implementing this would be to wrap the loop in a try and
74 change the break to be a throw.
75 Correct. I think Parenscript's LOOP is not doing a RETURN-FROM, which
76 would generate a throw in cases like this.
79 jasom commented on Jan 17
81 I locally fixd the BREAK to use RETURN-FROM and it gets worse; note that var _js55 = FIRST58 ? 0 : _js55 + 1; is inside the lambda, so js55 is zero on the first iteration and NaN thereafter.
83 Previously only the non-gensymed variables were declared in the with block so the gensym variables took the outer scope; this obviously is not what happens when you replace the with with a lambda. The fix is likely going to involve hoisting those variable declarations out of the loop body; I'm busy with other things currently so it may take several days before I report back.
84 * Add DOM3 and DOM4 symbols to PS-DHTML-SYMBOLS
85 https://github.com/vsedach/Parenscript/issues/14
86 * Merge ZEROP, FORMAT from https://github.com/mgi/Parenscript
87 * Add ECMAScript 2015 support
88 https://github.com/pjstirling/Parenscript