Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DEFAULT Type
#1
How about a addition?
Usually the variable type is allways float by default, and you can change the type of variables using DIM variable AS Type. Would it be possible to change the default type from float to different type (except String), using DEFAULT directive. E.g. DEFAULT UINTEGER will change the type of all uninitialised variables from Float to Uinteger.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#2
Hmm. I see.
But instead of the classical DEFAULT a-z or the like, just declare someting like:
Code:
DEFAULT As Integer
' Or
DIM DEFAULT As Integer
' OR
DIM As Integer By Default
Or something like that? Anyway, I think it's a good idea (I created the compiler with a default type in mind, and can be easily set up Wink)
Reply
#3
boriel Wrote:Hmm. I see.
But instead of the classical DEFAULT a-z or the like, just declare someting like:
Code:
DEFAULT As Integer
' Or
DIM DEFAULT As Integer
' OR
DIM As Integer By Default
Or something like that? Anyway, I think it's a good idea (I created the compiler with a default type in mind, and can be easily set up Wink)
Excellent!
I think, the best would be
Code:
DEFAULT As Integer
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#4
Default what?

:-)

I think logically it has to say DIM in it - something like DEFAULT DIM uinteger or DIM DEFAULT uinteger

Otherwise, it might be unclear what you are defaulting? (Okay, when we know the language, it's obvious - but it's just a thought that "default as uinteger" doesn't actually say, which feels like poor logic)
Reply
#5
britlion Wrote:Default what?

:-)

I think logically it has to say DIM in it - something like DEFAULT DIM uinteger or DIM DEFAULT uinteger

Otherwise, it might be unclear what you are defaulting? (Okay, when we know the language, it's obvious - but it's just a thought that "default as uinteger" doesn't actually say, which feels like poor logic)
This is why I proposed
Code:
DIM As Uinteger By DEFAULT
Reply
#6
Yes - I was pretty much supporting you, there, Boriel :-)
Reply
#7
Then you could also make
Code:
DIM AS Uinteger
with no variable name...
or as boriel said,
Code:
DIM DEFAULT AS Uinteger
DEFAULT will be a reserved word anyway.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)