Show
Ignore:
Timestamp:
10/20/09 16:02:16 (5 weeks ago)
Author:
jmaessen
Message:

[library, tests] Added simple Treap library that is non-parametric in
the hopes of shaking out a bunch of lingering compiler bugs. This
required adding randomness to CompilerBuiltin (where it _doesn't_
disrupt testing times). Right now Treap doesn't even pass type
checking yet due to #360. Coalescing Treap and TreapTest into a
single file turns up code generation bugs having to do with the
internals of asm; the ManglingClassWriter has been modified to give
more information about these sorts of failure in the hopes that we can
debug the problems in future.

Location:
trunk/ProjectFortress/LibraryBuiltin
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/ProjectFortress/LibraryBuiltin/CompilerBuiltin.fsi

    r4259 r4273  
    2525 
    2626trait String 
     27    getter isEmpty(): Boolean 
    2728    getter asString(): String 
     29    opr |self| : ZZ32 
    2830    opr || (self, b:String):String 
    2931    opr juxtaposition(self, b:String): String 
     
    9799false : Boolean 
    98100 
     101(************************************************************ 
     102* Random numbers 
     103************************************************************) 
     104 
     105random(i:RR64): RR64 
     106randomZZ32(x:ZZ32): ZZ32 
     107 
    99108end 
  • trunk/ProjectFortress/LibraryBuiltin/CompilerBuiltin.fss

    r4259 r4273  
    1818component CompilerBuiltin 
    1919import java com.sun.fortress.nativeHelpers.{simplePrintln.nativePrintln => jPrintln} 
    20 import java com.sun.fortress.nativeHelpers.{simpleConcatenate.nativeConcatenate => jConcatenate} 
     20import java com.sun.fortress.nativeHelpers.{simpleConcatenate.nativeConcatenate => jConcatenate, 
     21                                            simpleConcatenate.nativeStrlen => jStrlen} 
    2122import java com.sun.fortress.nativeHelpers.{simpleIntArith.intToString => jIntToString, 
    2223                                            simpleIntArith.intAdd => jIntAdd, 
     
    4849                                            simpleDoubleArith.doublePow => jDoublePow, 
    4950                                            simpleDoubleArith.doubleNanoTime => jNanoTime} 
     51import java com.sun.fortress.nativeHelpers.{LocalRandom.localRandomDouble => jRandomDouble, 
     52                                            LocalRandom.localRandomInt => jRandomInt } 
    5053import AnyType.{Any} 
    5154export CompilerBuiltin 
     
    5760 
    5861trait String 
     62    getter isEmpty(): Boolean = (jStrlen(self) = 0) 
    5963    getter asString(): String = self 
     64    opr |self| : ZZ32 = jStrlen(self) 
    6065    opr ||(self, b:String): String =  jConcatenate(self, b) 
    6166    opr juxtaposition(self, b:String): String = jConcatenate(self, b) 
     
    141146false : Boolean = (0=1) 
    142147 
     148(************************************************************ 
     149* Random numbers 
     150************************************************************) 
     151 
     152random(i:RR64): RR64 = jRandomDouble(i) 
     153randomZZ32(x:ZZ32): ZZ32 = jRandomInt(0,x) 
     154 
    143155end