[Aldor-l] is sal_sfloat.as buggy?

Ralf Hemmecke ralf at hemmecke.de
Tue Sep 25 06:42:30 EDT 2007


>   import { powf: (SFlo, SFlo) -> SFlo } from Foreign C;

I take back my last comment and support this signature given by Christian.

In fact, David's first version should be OK, too.

----------------------------------------------------------------------
      Rep == SFlo;

-- ...

  	(a:%) ^ (b:%):%	== {
  		import { powf: (Rep, Rep) -> Rep } from Foreign C;
  		per powf(rep a, rep b);
  	}
----------------------------------------------------------------------

But I agree with Christian, that the import statement should *not* use 
Rep but SFlo. There should be an error if someone someday changes

   Rep == SFlo

(and only this line) into something else.

Note that there are several such wrong imports in the libraries. For 
example,

   import { fopen:(Pointer,Pointer) -> Pointer; } from Foreign C;

in sal_file.as is also wrong according to the AUG chp 19.3, p. 195 
(http://aldor.org/docs/HTML/chap19.html). It should read

   import { fopen: (Ptr, Ptr) -> Ptr; } from Foreign C;

Note that the definition in sal_dfloat.as is

	(a:%) ^ (b:%):%	== {
	--LDR
	--	import { pow: (%, %) -> % } from Foreign C;
	--	pow(a, b);
		import { pow: (DFlo, DFlo) -> DFlo } from Foreign C;
		pow(a::DFlo, b::DFlo)::%;
	}

But that is clear given that this file also says...

   -- TEMPORARY: DFlo MUST BE BOXED IN 1.1.13 OR THEY CRASH AT RUNTIME
   -- Rep == DFlo;
   -- macro pper == per;
   -- macro prep == rep;
   Rep == Record(float:DFlo);

(Does somebody know who LDR is?)

Ralf




More information about the Aldor-l mailing list