Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
token engine?
#11
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.
Reply
#12
They are not, generally, but as I said that can be solved using some extra coding, for example introducing ambits (sp?).
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#13
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.
Reply
#14
Why not just have classes then...?
Reply
#15
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.
Reply
#16
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.
Reply
#17
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.
Reply
#18
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.
Reply
#19
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.
Reply
#20
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)