In the first example the word MyMap is ambiguous because it refers to a subroutine name and to a name of a map.
This is a little bit confusing.
Sub Process_Globals
Private AnotherValue As Int
End Sub
Sub AppStart (Args() As String)
Log(AnotherValue)
MyMap
Log(AnotherValue)
Log(MyMap)
Log("value:" & MyMap.Get("key"))
AnotherValue = 7
Log(MyMap)
Log("value:" & MyMap.Get("key2"))
Dim value As Int = MyMap.Get("key2")
Log(value)
End Sub
Sub MyMap As Map
If AnotherValue = 7 Then Return CreateMap("key2": 10)
AnotherValue = 6
Return CreateMap("key": AnotherValue)
End Sub
In the second example the method name DB.Find(id) can not be used as a map name, i think.
But why do you want to use a return value in that method if you are not going to use it later?