Posts: 3,368
Threads: 195
Joined: Jan 2003
Hmmm...
Well, basically all these enhancements depend on memory:
*inheritance ("SUBSET OF")
*TYPE > array conversion
Etc etc etc.
I just don't see how any compiled language could possibly be "context free".
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 6,419
Threads: 74
Joined: Mar 2002
They are not, generally, but as I said that can be solved using some extra coding, for example introducing ambits (sp?).
Posts: 3,616
Threads: 287
Joined: Jan 2003
What I'd like to see is a version of QB that supports TYPEs having constructors. Would be bloody useful.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 1,752
Threads: 21
Joined: Jun 2002
Why not just have classes then...?
Posts: 3,368
Threads: 195
Joined: Jan 2003
C++, C, etc: too many namespaces. I think the best way is that everything can be reduced back to one array namespace and one variable namespace. (global/local, of course)
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,616
Threads: 287
Joined: Jan 2003
Quote:Why not just have classes then...?
I don't need classes - just let TYPEs have constructors. A page of code is dedicated to setting TYPEs' values...I wish I could do that on one line.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 3,368
Threads: 195
Joined: Jan 2003
So you want initial values inside the type, like this?
Code:
TYPE var1
blah AS INTEGER
blah = 5
END TYPE
There is a slippery slope with this, unfortunately. Once you have default values, you can add lots of other stuff such as loops, math, function calling inside the TYPE...
I think that it is imperative that one stops there. Without default values inside the types themselves, it can lead to a lot of repetitive code if the TYPE attributes are inherited in another TYPE. (like in my example) But it's still very slippery.....
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,616
Threads: 287
Joined: Jan 2003
No, I want something more like this:
Code:
TYPE myType
x AS INTEGER
y AS INTEGER
SUB constructor(defx,defy)
x=defx
y=defy
END SUB
END TYPE
Then you call the constructor like this:
Code:
DIM myVar as myType(10,5)
And now myVar.x equals 10, and myVar.y equals 5. See?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 3,368
Threads: 195
Joined: Jan 2003
So tell me again why that's better/easier than just saying the value?
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,616
Threads: 287
Joined: Jan 2003
You mean just saying...
Code:
TYPE myType
x AS INTEGER
y AS INTEGER
END TYPE
DIM myVar AS myType
myType.x=10
myType.y=5
Well, what if I have 25 variables in my TYPE? Rather than pumping out 25 lines of code...one line.
It's not a big deal. It would just make life a little easier.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.