Author Topic: Latest Alpha Release (Available on Web Site)  (Read 26500 times)

0 Members and 1 Guest are viewing this topic.

Charles Pegge

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #30 on: July 25, 2011, 08:17:38 AM »
Fixed an "export" bug.

I have now got the first self-compile. Still lots to do but it was easier than I expected.

Charles
« Last Edit: July 26, 2011, 08:39:48 PM by Charles Pegge »

Peter

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #31 on: July 25, 2011, 10:00:39 AM »
I have an alpha release nightmare!   :D

efgee

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #32 on: July 25, 2011, 12:52:46 PM »
I have now got the first self-compile....

Yeah, the resulting oxy.exe needs to compile files as well... ups  :-X

Charles Pegge

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #33 on: July 25, 2011, 01:32:20 PM »
You are ahead of me guys! I have only just got it to produce a binary. There's much more to be done in the debugging and optimisation department. The time required, I estimate to be about 10 times longer than this stage.

The EXE is to facilitate early testing but I advise against trying to run it without safety helmet and goggles :o

Charles

PS:
One curiosity: The code is about 30% longer than the FB compile, yet compresses 30% smaller in a zip file. (114K). Presumably there are more repeating elements, favouring greater compression.
« Last Edit: July 25, 2011, 02:25:04 PM by Charles Pegge »

Charles Pegge

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #34 on: July 26, 2011, 08:45:49 PM »

This fixes a bug with string constants:

const string s="abc"

And also resolves the problem that Peter reported with procedure overloading. (SaveFile 2 definitions)

Charles

[attachment deleted by admin]

Charles Pegge

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #35 on: August 15, 2011, 04:27:00 AM »
I try to avoid emitting too many versions!

This one has more efficient string parameter passing, and a number of minor corrections/adjustments. Most of these have been fed back from the Self-compile project.

Charles

[attachment deleted by admin]

Peter

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #36 on: August 15, 2011, 06:04:48 AM »
Thanks Charles,

The new  *.dl makes indeed overload!     :D

Charles Pegge

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #37 on: August 15, 2011, 09:41:45 AM »

Also fixed: :)

Code: OxygenBasic
  1. 'RETURNING cOUNTERS
  2. '==================
  3.  
  4. sys number[2]  
  5.  
  6. Function Count() as long
  7.  
  8. Return  number[2]++
  9. 'Return 10+number[2]++  
  10. 'Return 10+(number[2]=number[2]+1)
  11. 'Return 10+(number[2]=number[2]+2)+100
  12.  
  13. End Function  
  14.  
  15.  
  16. print count()
  17. print number[2]
  18.  
  19.  

Charles

Charles Pegge

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #38 on: August 16, 2011, 08:01:39 AM »

Another feature I have reintroduced in this version, which I hope will assist modular programming.

You can hide most things inside a scope, then select the functions you want to be visible by tagging them as exposed.

Code: OxygenBasic
  1. 'Scoping and selectively Exposing functions in Oxygen
  2. '====================================================
  3.  
  4. declare function f1()
  5. declare function f2()
  6.  
  7.  
  8. scope
  9.   const string s="This is module1"
  10.   function f1() exposed
  11.     print s
  12.   end function
  13. end scope
  14.  
  15.  
  16. scope
  17.   const string s="This is module2"
  18.   function f2() exposed
  19.     print s
  20.   end function
  21. end scope
  22.  
  23. f1()
  24. f2()
  25.  

Charles

Peter

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #39 on: August 16, 2011, 10:36:27 AM »
Thanks Charles,

scope is a further OxygenBasic secret..

Code: [Select]
declare function Hypozykloide(single x1,y1,r) 
 
scope 
  single d=100,x,y,R=90,r,ß=45
  function Hypozykloide(single x1,y1,r) exposed 
    x=d*cos((1-R/r)*ß)+R-r*cos(ß)
    y=d*sin((1-R/r)*ß)+R-r*sin(ß)
    print x*pi/180
    print y*pi/180
   end function 
end scope 
 
Hypozykloide 10,10,45
Hypozykloide 10,10,90
Hypozykloide 10,10,180

efgee

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #40 on: August 16, 2011, 07:01:00 PM »
Would it not be better (syntax wise) to have:

exposed function f1() as long

otherwise if there is a return type it would be:

function f1() as long exposed

which somehow looks silly to me.

  ;)

JRS

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #41 on: August 16, 2011, 09:24:49 PM »
I see the SCOPE/END SCOPE as defining module status to that block of code. If you call a function in a SCOPE structure, variables access is restricted to those variables within that SCOPE structure.

If I'm wrong in my assumption, please enlighten me.




Charles Pegge

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #42 on: August 16, 2011, 09:48:39 PM »
Frank,

I take your point. Exposed has been assigned to the group of function tag words including at, link, external, export, com. I can improve the sense by allowing commas to be used between these words. What do you think?

function f1() as long, exposed

John,

Scope is a nesting construct. Everything defined above the scope is visible from the inside, but anything defined inside the scope is not normally visible to the outside. When the scope closes, all the symbols that were created within the scope are forgotten.

All functions and classes use this mechanism to isolate their static and local variables.

Charles
« Last Edit: August 16, 2011, 09:54:11 PM by Charles Pegge »

Peter

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #43 on: August 17, 2011, 03:12:53 AM »
Code: [Select]
function f1() as long, exposed ?
who used something like this ?  keep the standard.

Charles Pegge

  • Guest
Re: Latest Alpha Release (Available on Web Site)
« Reply #44 on: August 17, 2011, 09:40:54 AM »
I believe this is a novel feature. Also the localisation of macros, the nestability of classes and functions, one inside the other, are not features found in Basic or C++.

Charles