Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending the language
#4
Hmmm. It seems my answer got lost... :?:

Currently it's almost impossible to extend the language that way, but it might be in the future. By enforcing FREEBASIC compatibility I lost VBScript compatibility (somewhat). In VB you can define subs and call them with IDENTIFIER PARAM1, PARAM2 ... (with no parenthesis).

This way you can declare a subrutine like:
Code:
SUB MICROPAINT(Param1, param2...)
...
END SUB
And later call it with

Code:
MICROPAINT Param1, Param2... : REM No parenthesis needed

But other than cosmetic syntax, it's exactly the same you have already. In fact this is a classic (static) compiler, like C, BASIC, C++, etc...
So the compiler is not ready for this. I'm not sure whether this will be really useful. The power of C/C++ IMHO resides in their library. C cannot be extended without changing the compiler... though this seems to be changing nowadays.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)