Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding new commands to ZX BASIC
#3
britlion Wrote:To add commands to the compiler, you'd have to rewrite the compiler such that it knew what to do with new commands. So far that's been down to Boriel only.

To add new features, however - we do that all the time. You can write functions and subroutines and publish them for others to use. Ideally, add them to the Library in the wiki. <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Library">http://www.boriel.com/wiki/en/index.php ... IC:Library</a><!-- m -->
It's like Britlion says. If you think in a language like C, it has succeeded because it's very simple (only 20 keywords or less) and has a lot of libraries.

If you make ZX BASIC to compile for other computer architecture, what happens if it is text only? Or any other strange device?
That's why POINT and ATTR for example are in the library: on some other computers ATTR and POINT will make no sense. :roll:
So the best way will be to implement those function and subs on include files.

Of course there are some core features missing I would like to add (but at the moment I'm not even living at my home!)
For example:
- ON ... GOTO/GOSUB (e.g. ON <expression> GOTO 100, 200, 300
- SELECT ... CASE (equivalent of Switch in c)
- More complex data strucrures
etc. etc.

These require syntactic changes, and I'm working hard to move them to the new parser (2.0 or 1.4) scheme.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)