Skip to content

Commit

Permalink
Remove program-not-finished?
Browse files Browse the repository at this point in the history
Replace with content in main loop
  • Loading branch information
fraya committed May 13, 2024
1 parent cd5e008 commit edf21d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
7 changes: 1 addition & 6 deletions sources/brainfuck.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ define sealed class <bf> (<object>)
init-keyword: memory:;
end;

define inline method program-not-finished?
(bf :: <bf>) => (finished? :: <boolean>)
bf.bf-pp < bf.bf-program.size
end;

////////////////////////////////////////////////////////////////////////
//
// Brainfuck interface
Expand Down Expand Up @@ -59,7 +54,7 @@ end;

define method run!
(bf :: <bf>) => (bf :: <bf>)
while (program-not-finished?(bf))
while (bf.bf-pp < bf.bf-program.size)
execute(bf.bf-program[bf.bf-pp], bf);
bf.bf-pp := bf.bf-pp + 1
end;
Expand Down
5 changes: 0 additions & 5 deletions sources/library.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ define module brainfuck-impl
<memory-pointer-decrement>,
<reset-to-zero>;

// Program exports

export
program-not-finished?;

// Jumps

export
Expand Down

0 comments on commit edf21d2

Please sign in to comment.