Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
|
|
@ -0,0 +1,37 @@
|
|||
Type Method
|
||||
Func As Function() As String
|
||||
End Type
|
||||
|
||||
Function DefaultMethod() As String
|
||||
Return "no such method"
|
||||
End Function
|
||||
|
||||
Type Objeto
|
||||
Methods As Method Ptr
|
||||
End Type
|
||||
|
||||
Sub Invoke(obj As Objeto, methodName As String)
|
||||
If methodName = "exists" Then
|
||||
Print obj.Methods->Func()
|
||||
Else
|
||||
Print DefaultMethod()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Function exists() As String
|
||||
Return "exists"
|
||||
End Function
|
||||
|
||||
Function CreateObject() As Objeto
|
||||
Dim As Objeto obj
|
||||
Dim As Method met
|
||||
met.Func = @exists
|
||||
obj.Methods = @met
|
||||
Return obj
|
||||
End Function
|
||||
|
||||
Dim As Objeto o = CreateObject()
|
||||
Invoke(o, "exists")
|
||||
Invoke(o, "non_existent_method")
|
||||
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue