diff --git a/sources/brainfuck.dylan b/sources/brainfuck.dylan index 1269e67..7cf6ae8 100644 --- a/sources/brainfuck.dylan +++ b/sources/brainfuck.dylan @@ -3,18 +3,6 @@ Synopsis: Brainfuck core Author: Fernando Raya Copyright: GPLv3 -define constant $memory-size - = 30000; - -define constant - = ; - -define constant - = limited(, of: , size: $memory-size); - -define constant - = ; - define sealed class () slot bf-pp :: = 0, init-keyword: program-pointer:; @@ -22,7 +10,8 @@ define sealed class () init-keyword: memory-pointer:; constant slot bf-program :: , required-init-keyword: program:; - constant slot bf-memory :: = make(, fill: 0), + constant slot bf-memory :: + = make(, fill: 0, size: $default-memory-size), init-keyword: memory:; end; diff --git a/sources/brainfuck.lid b/sources/brainfuck.lid index 51dae78..b1bc4f3 100644 --- a/sources/brainfuck.lid +++ b/sources/brainfuck.lid @@ -1,5 +1,6 @@ Library: brainfuck Files: library.dylan + memory.dylan instruction.dylan comment-instruction.dylan io-instruction.dylan diff --git a/sources/memory.dylan b/sources/memory.dylan new file mode 100644 index 0000000..9bd30de --- /dev/null +++ b/sources/memory.dylan @@ -0,0 +1,16 @@ +Module: brainfuck-impl +Synopsis: Brainfuck memory +Author: Fernando Raya +Copyright: GPLv3 + +define constant $default-memory-size + = 30000; + +define constant + = ; + +define constant + = limited(, of: ); + +define constant + = ;