Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit 6a7ea03

Browse files
committed
Add empty environment to closures in spawn-chain demo
1 parent 04fe93b commit 6a7ea03

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

examples/spawn-chain/src/elixir/chain.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ fn create_processes_reducer_function(
226226
process.pid_term(),
227227
module_function_arity,
228228
create_processes_reducer_0_code,
229+
vec![],
229230
)
230231
}
231232

examples/spawn-chain/src/elixir/enum.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ fn reduce_range_inc_0_code(arc_process: &Arc<ProcessControlBlock>) -> Result {
120120
TypedTerm::Boxed(boxed) => match boxed.to_typed_term().unwrap() {
121121
TypedTerm::Closure(closure) => {
122122
if closure.module_function_arity().arity == 2 {
123+
for term in closure.env_hack.iter() {
124+
arc_process.stack_push(*term)?;
125+
}
123126
arc_process.stack_push(acc)?;
124127
arc_process.stack_push(first)?;
125128

0 commit comments

Comments
 (0)