Oxygen Basic
Information => Development => Topic started by: Brian Alvarez on November 25, 2018, 09:34:56 PM
-
Now that the array system is nearly completed, i noticed that i need to also create arrays
of UDT members. I have a number of tricks to try, but i would like to know if Oxygen already
can do this.
basically what i would like is to have a class with a function that returns a user-defined-type
"variable" and use it like this:
MyClassObject.functionthatreturnsaUDT(dimension1, dimension2, dimension3).UdtMemberOfTypeLong = 12345
Is this already doable with Oxigen as it is? Thanks.
-
This is very interesting, and feasible with some extra work on o2. It is a two-part operation: first to return an object reference, then to get the required member.
-
This can also be done on my side, but i would like to focus on writing more stock functions...
What do you think? Are you up to it? :)
I'm almost done with ARRAY SCAN, then ARRAY SORT... after that, it will be a matter of getting
the above functionality to get PluriBASIC compiled for 64 bit...
Here is a sample of the complexity i need to compile:
IF SD(Part).Keyword = %DATA_VARIABLE THEN
IF VAR_DATA(SD(Part).Index).Dimensions THEN
MOD_DATA(Module).Param(Param).Dimensions = VAR_DATA(SD(Part).Index).Dimensions
VAR_DATA(SD(MOD_DATA(Module).Param(Param).SDIndex).Index).Dimensions = VAR_DATA(SD(Part).Index).Dimensions
VAR_DATA(MOD_DATA(Module).Param(Param).VIndex).Dimensions = VAR_DATA(SD(Part).Index).Dimensions
INCR MOD_DATA(Module).ArrSet
IF MOD_DATA(Module).Arrays = MOD_DATA(Module).ArrSet THEN
decr Incomplete
END IF
END IF
END IF
-
...It is a two-part operation...
Even for nested UDT members?
-
Yes, at the translator level, all these nestings must be decomposed into simple expressions and resolved in the correct sequence (innermost first).
for example:
a=b+c*fun()
--->
a=b+(c*fun())
--->
tmp1=fun()
--->
tmp2=c*tmp1
--->
a=b+tmp2
Accessing a member via a method might look like this:
a=v.meth(...).memb
--->
typeof(v) *temp
@temp=v.meth(...)
a=temp.memb