Skip to content

Commit

Permalink
Make generic functions explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
fraya committed May 13, 2024
1 parent aa21e15 commit 280514e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions sources/brainfuck.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,34 @@ end;

////////////////////////////////////////////////////////////////////////
//
// Execute methods
// Brainfuck interface
//
////////////////////////////////////////////////////////////////////////

define generic bf-pp
(bf :: <bf>) => (pp :: <program-pointer>);

define generic bf-mp
(bf :: <bf>) => (mp :: <memory-pointer>);

define generic bf-program
(bf :: <bf>) => (program :: <program>);

define generic bf-memory
(bf :: <bf>) => (memory :: <memory>);

define generic execute
(instruction :: <instruction>, bf :: <bf>) => ();

define generic run!
(object :: <object>) => (bf :: <bf>);

////////////////////////////////////////////////////////////////////////
//
// 'run' methods to execute a program in a brainfuck machine
//
////////////////////////////////////////////////////////////////////////

define generic run!
(object :: <object>) => (bf :: <bf>);

define method run!
(program :: <program>)
=> (bf :: <bf>)
Expand Down

0 comments on commit 280514e

Please sign in to comment.