Mark, Possible Features?

BlitzMax Forums/BlitzMax Programming/Mark, Possible Features?

Thanks for the response mark.

-Properties
you bring up some good points on that. I still think they are applicable for updating a Type which uses fields. With current methods if you want to insure being able to add code to field setters/getters you have to make get/set methods from the start and make all fields private. Not only ugly, this clutters up your type quite alot. With Properties, you can simply make your class with fields and if at some point, you decide to add code to setting/retrieving a variable, you can without breaking back-compatability.

Bit of a silly example:
Type TGadget Abstract
 Field X,Y, Width, Height
 Field Caption$
End Type
Lets say that originally you would just set values and an "UpdateGUI" function would be called. Later, you decide a more imediate method is better:
Type TGadget Abstract
 Private
 Field PX,PY, PWidth, PHeight
 Field PCaption$
 Public

 Property X
  Method Set(value)
   PX=value
   'BLAH:
   ?Windows
   Win_GUI_Set_Control_X(ID,value)
   ?Linux
   Lin_GUI_Set_Control_X(ID,value)
   ?MAC
   MAC_GUI_Set_Control_X(ID,value)
   ?
  End Method
  Method Get()
   Return PX
  End Method
 End Property

 Property Y
  Method Set(value)
   PY=value
   'BLAH:
   ?Windows
   Win_GUI_Set_Control_Y(ID,value)
   ?Linux
   Lin_GUI_Set_Control_Y(ID,value)
   ?MAC
   MAC_GUI_Set_Control_Y(ID,value)
   ?
  End Method
  Method Get()
   Return PY
  End Method
 End Property

 Property Width
  Method Set(value)
   PWidth=value
   'BLAH:
   ?Windows
   Win_GUI_Set_Control_Width(ID,value)
   ?Linux
   Lin_GUI_Set_Control_Width(ID,value)
   ?MAC
   MAC_GUI_Set_Control_Width(ID,value)
   ?
  End Method
  Method Get()
   Return PWidth
  End Method
 End Property

 Property Height
  Method Set(value)
   PHeight=value
   'BLAH:
   ?Windows
   Win_GUI_Set_Control_Height(ID,value)
   ?Linux
   Lin_GUI_Set_Control_Height(ID,value)
   ?MAC
   MAC_GUI_Set_Control_Height(ID,value)
   ?
  End Method
  Method Get()
   Return PHeight
  End Method
 End Property

 Property Caption
  Method Set(value$)
   PCaption=value
   'BLAH:
   ?Windows
   Win_GUI_Set_Control_Caption(ID,value)
   ?Linux
   Lin_GUI_Set_Control_Caption(ID,value)
   ?MAC
   MAC_GUI_Set_Control_Caption(ID,value)
   ?
  End Method
  Method Get()
   Return PCaption
  End Method
 End Property
End Type


-Overloaded methods
Well, yes, type casting might be a bit tricky, but stuff sugested where the compiler looks "up" the data types would work. I think its not a bad price to pay. Also, yeah, I doubt noobs will use it much. Most of my features - properties, overloaded members, and private members are target at diffucultys and solutions in writing modules. I'd say that a decent variable casting scheme could be created that worked in most cases.

-Getting rid of Framework
Hmm. You are correct, mark only an uber compiler could figure that out. Maybe an interpreter XD... It would be possible to code for special cases but this isnt really the greatest idea. Perhaps in release mode, though, only include the necessry modules, no matter if it can't figure out exactly which in that specific case.