bobbimanners / EightBall

The Eight Bit Algorithmic Language for Apple II, Commodore 64 and VIC20
GNU General Public License v3.0
19 stars 3 forks source link

Implement support for constants #23

Closed bobbimanners closed 6 years ago

bobbimanners commented 6 years ago

Would be nice to be able to define constants and use them in constant expressions.

For example

const size=10
word A[size*size] = {}
word i=0
for i=1:size
 A[i]=1
endfor

However we are super short of memory so we may need to implement this in a devious way.

bobbimanners commented 6 years ago

Maybe this is a 'cheaper' way to implement this feature:

word _size=10

Currently variable names must begin with alpha character. We could use a leading underscore to mark a constant.

bobbimanners commented 6 years ago

Maybe with trailing _ too?

word _size_=10; ' Looks better?
bobbimanners commented 6 years ago

Implemented in v0.66 (with nicer syntax - see docs!)