Skip to content

Commit

Permalink
fix Petrifsky let #341
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 17, 2024
1 parent e628432 commit cc38fea
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
* fix escape ellipsis in syntax-rules [#334](https://github.com/jcubic/lips/issues/334)
* fix parsing inexact complex without real part and `inexact->exact` procedure [#340](https://github.com/jcubic/lips/issues/340)
* fix `equal?` on cycles [#302](https://github.com/jcubic/lips/issues/302)
* fix Petrifsky let [#341](https://github.com/jcubic/lips/issues/341)

## 1.0.0-beta.18
### Breaking
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.18.1-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
![1.0.0 Complete](https://img.shields.io/github/milestones/progress-percent/jcubic/lips/1?label=1.0.0%20Complete)
[![Build and test](https://github.com/jcubic/lips/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/lips/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&8be72fb7b00619ee49e363fd919a2c7b)](https://coveralls.io/github/jcubic/lips?branch=devel)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&9804e2dd94f41ac5863abe4d474d3cc2)](https://coveralls.io/github/jcubic/lips?branch=devel)
[![Join Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jcubic/lips)
![NPM Download Count](https://img.shields.io/npm/dm/@jcubic/lips)
![JSDelivr Download count](https://img.shields.io/jsdelivr/npm/hm/@jcubic/lips)
Expand Down
11 changes: 6 additions & 5 deletions dist/lips.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions dist/lips.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lips.esm.min.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions dist/lips.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/lips.min.js

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions src/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -4826,12 +4826,15 @@ function let_macro(symbol) {
params = code.cdr.car.map(pair => pair.car);
args = code.cdr.car.map(pair => pair.cdr.car);
}
const args_name = gensym('args');
return Pair.fromArray([
LSymbol('letrec'),
[[code.car, Pair(
LSymbol('lambda'),
Pair(params, code.cdr.cdr))]],
Pair(code.car, args)
LSymbol('let'),
[[args_name, Pair(LSymbol('list'), args)]],
[LSymbol('letrec'),
[[code.car, Pair(
LSymbol('lambda'),
Pair(params, code.cdr.cdr))]],
[LSymbol('apply'), code.car, args_name]]
]);
} else if (macro_expand) {
// Macro.defmacro are special macros that should return lips code
Expand Down
2 changes: 1 addition & 1 deletion tests/std.scm
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
(t.is (atanh -2)
-0.5493061443340548+1.5707963267948966i)))

(test.failing "std: Petrofsky let"
(test "std: Petrofsky let"
(lambda (t)
(t.is (let - ((n (- 1))) n) -1)))

Expand Down

0 comments on commit cc38fea

Please sign in to comment.