Oxygen Basic
Programming => Bugs & Feature Requests => Topic started by: Mike Lobanovsky on September 22, 2014, 01:44:40 AM
-
Charles,
Please run this:
function test() as double
return 1.0
end function
print 5.0 / test()
or this:
function test() as double
return 1.0
end function
print 5.0 \ test()
or this:
function test() as long
return 1
end function
print 5 / test()
or this:
function test() as long
return 1
end function
print 5.0 / test()
or this:
function test() as long
return 1
end function
print 5.0 \ test()
This works:
function test() as long
return 1
end function
print 5 \ test()
:(
-
Sorry Mike, bad commutation, affecting n/fun() and n-fun()
Fixed:
http://www.oxygenbasic.org/o2zips/Oxygen.zip
-
THNX, PERFECT! :(
-
Sorry Charles,
It ain't perfect. Please run this:
string curchar = "3"
double tot = 3
print tot * 10 + val(curchar)
It yields 3. :(
(Can somebody give me the old gxo2.exe + Oxygen.dll from a zip before September 20 for the time being? I deleted mine when I got the new ones. :-[ I'm losing days to kill bugs in OxyLISP which aren't really there...)
-
Mike, here is the previous gxo2. But there should not be any difference unless you are compiling from the console.
Please try with the current Oxygen.dll
This bug does not appear to be related to the recent fixes.
.
-
Nope, the test fails with this gxo2.exe too. Seems the bug comes from the Oxygen.dll download above. Perhaps fixing division and subtraction causes it.
I lost the ability to enter fractional numbers into OxyLISP. E.g. if I'm trying to enter 3.333, I get 0.003. The multiplication result above is lost and only the trailing val() is added to empty tot that loses its initial value as well. :(
-
Ah yes, it has exposed a bug in val relating to extended types, used as temp storage.
May take a while to fix
Simple workaround: define your own val:
function val (string s ) as double
return s
end function
-
OK Charles,
I'll try to do that and will report shortly. But the gxo2 that you sent me is not the old gxo2 I used to use. That one was some 49KB in size while this one is just under 42KB. Or is my memory slipping me?
P.S. Can I overload an Oxygen keyword function just like that? (I can do it in FBSL but what about O2?)
-
Okay, I've squelched it! Closer scrtutiny of the extended type will be needed in the future. Maybe to drop it. - not C compatible.
val should now be okay.
http://www.oxygenbasic.org/o2zips/Oxygen.zip
It was the original gxo2, (skipping a more recent build). Perhaps you could try the latest gxo2 again - it should work exactly the same, except for the -m console option.
-
Yeah, guess that came from PowerBASIC via thinBasic, didn't it? ;)
Going 32 bits again to test your fixes and report.
Thanks!
-
Yes, you can override most things in Oxygen, globally or with limited scope. even register names, as long as you don't try to do asm with them in the same scope.
-
(Under 32 bits)
Overloading is OK. Does it relate to functions only? I can't overload FBSL keywords like FROM/TO/WHILE/DO/etc., only intrinsic, 3rd-party dll, and user functions. Is it the same in O2?
(P.S. See my report from 64 bits -- you haven't seen it yet, I suppose.)
-
Hehe yes,
Now my floats are working as expected, at least for now. You won't believe it but I spent 6 hours trying to debug my gcd() and lcm() functions for OxyLISP all in vain before I realized something was generally wrong with floats... :D
Can I now mark this thread [SOLVED], do you think? ;)
-
Following you and Charles in these threads is like watching batting practice for the new season. ;)
-
Hi John,
That's only natural. Debugging a mature language is impossible without big projects. Mandelbrot pictures don't help at this stage any more. :)
-
Yes, I think this is solved. Sorry you were diverted, Mike - too many changes in parallel !
I'm taking a few hours off now for some lucid dreaming practice :)
-
Couldn't agree more. In fact I have been telling Eros that same thing for years. He must be holding out for a miracle. :o
-
It's my pleasure to work with you, Charles. Have a good rest! :)