Skip to content

Commit e04ada2

Browse files
committed
Cleanup member function syntactic_closure::identify
Signed-off-by: yamacir-kit <httperror@404-notfound.jp>
1 parent e6168b4 commit e04ada2

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ Then, select one of the following targets and `make` it according to your purpos
9898

9999
| Target | Description
100100
|-------------|-------------
101-
| `all` | Build shared-library `libmeevax.0.5.321.so` and executable `meevax`.
101+
| `all` | Build shared-library `libmeevax.0.5.322.so` and executable `meevax`.
102102
| `install` | Copy files into `/usr/local` directly.
103-
| `package` | Generate debian package `meevax_0.5.321_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.321_amd64.deb`.
103+
| `package` | Generate debian package `meevax_0.5.322_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.322_amd64.deb`.
104104
| `test` | Test executable `meevax`. This target requires Valgrind to be installed.
105105
| `uninstall` | Remove files copied to `/usr/local` directly by target `install`.
106106

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.321
1+
0.5.322

include/meevax/kernel/syntactic_environment.hpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,19 @@ namespace meevax::inline kernel
151151
an appropriate de Bruijn index. In the example above, this is (() ()
152152
(x)).
153153
*/
154-
let aligned_bound_variables = environment.as<syntactic_environment>().first;
155-
156-
for (auto offset = length(bound_variables) - length(environment.as<syntactic_environment>().first); 0 < offset; --offset)
154+
auto identify = [&]()
157155
{
158-
aligned_bound_variables = cons(unit, aligned_bound_variables);
159-
}
156+
let xs = environment.as<syntactic_environment>().first;
157+
158+
for (auto offset = length(bound_variables) - length(xs); 0 < offset; --offset)
159+
{
160+
xs = cons(unit, xs);
161+
}
162+
163+
return environment.as_const<syntactic_environment>().identify(form, xs);
164+
};
160165

161-
if (let const& identity = environment.as_const<syntactic_environment>().identify(form, aligned_bound_variables); identity != f)
166+
if (let const& identity = identify(); identity != f)
162167
{
163168
return identity;
164169
}

0 commit comments

Comments
 (0)