You are right Properties and Methods are separated, but actually it's not a big deal.Kale wrote:Aye but surely implementing Virtual Tables can be done more elegantly. I hate the way you have to create vtables using interfaces. And using interfaces, the properties are seperate from methods. leading to an interface declaration and properties structure plus i can't find a way to set property values without an interface method.Fred wrote:Using interfaces allows to skip the repetition of the first argument, which is a must, as it looks much better IMHO (and is faster).
Also the Properties are secure. Nobody can change them except he uses the Method you defined.
This way if you provide a object class you are in control how the properties are processed, which in turn is much more safe.
Virtual tables are not bad either.
Look at it that way: what you have done here
Code: Select all
Skulls\EchoValues = @EchoValues()
Skulls\MoveSkull = @MoveSkull()
Skulls\InitialiseSkull = @InitialiseSkull()
Skulls\DisplaySkull = @DisplaySkull()

This is the same with a Virtual table:
Code: Select all
DataSection
SkullClass_Methods:
Data.l @EchoValues(), @MoveSkull(), @InitialiseSkull(), @DisplaySkull()
EndDataSection

BTW: here you can see what I've already done with V4:
Code: Select all
;oop style
Procedure MyProc()
MessageRequester("Hi!", "It's me")
EndProcedure
Procedure My2ndProc()
MessageRequester("Hi!", "No it's me")
EndProcedure
; --------------------------------------------------------------
;start main code
TheApp.ApplicationClass = Application()
;Create Main Window with default values
MainWindow.WindowClass = Window("myTitle")
;this Button will be placed with default values
MyButton1.GadgetClass = Button("MyButton")
MyButton1\Connect(@MyProc())
MyButton2.GadgetClass = Button("MyButton", 50, 150, 80, 50)
MyButton2\Connect(@My2ndProc())
;this keeps the app running
TheApp\Run("Quit?")
Debug "END: now you can clean stuff up if you need to..."
End
Even event handling is done without a long REPEAT-UNTIL loop.
But there is still much work to do...