Changeset 1450

Show
Ignore:
Timestamp:
03/31/08 13:37:28 (3 months ago)
Author:
sukyoungryu
Message:

1. Minor revisions on the top-level README file.
2. Eliminated FTypeDynamic from the interpreter.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/Init.java

    r1408 r1450  
    2222import com.sun.fortress.interpreter.evaluator.types.FTypeBufferedWriter; 
    2323import com.sun.fortress.interpreter.evaluator.types.FTypeChar; 
    24 import com.sun.fortress.interpreter.evaluator.types.FTypeDynamic; 
    2524import com.sun.fortress.interpreter.evaluator.types.FTypeFloat; 
    2625import com.sun.fortress.interpreter.evaluator.types.FTypeFloatLiteral; 
     
    5453    // For leak detection. 
    5554    static int countdown=4; 
    56      
     55 
    5756    public static void initializeEverything() { 
    5857        FTypeArrow.reset(); 
     
    6766        FTypeVoid.ONLY.resetState(); 
    6867        FTypeTop.ONLY.resetState(); 
    69         FTypeDynamic.ONLY.resetState(); 
    7068 
    7169        FTypeBufferedWriter.ONLY.resetState(); 
     
    8280        FTypeString.ONLY.resetState(); 
    8381        FTypeStringLiteral.ONLY.resetState(); 
    84          
     82 
    8583        BottomType.ONLY.resetState(); 
    8684        FTypeRange.ONLY.resetState(); 
     
    8987        FTypeFloatLiteral.ONLY.resetState(); 
    9088        FTypeStringLiteral.ONLY.resetState(); 
    91          
     89 
    9290        NativeApp.reset(); 
    9391 
     
    9997                Thread.sleep(1000000000); 
    10098            } catch (InterruptedException ex) { 
    101                  
     99 
    102100            } 
    103101        } 
    104          
     102 
    105103    } 
    106104 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTuple.java

    r1442 r1450  
    142142                 * omitted type information in 
    143143                 * tests/overloadTest3.fss. */ 
    144                 return (currType==FTypeDynamic.ONLY); // this is one place where we might need Dynamic 
     144                // this is one place where we might need Dynamic 
     145                return (currType==FTypeTop.ONLY); 
    145146            } else { 
    146147                return true; 
  • trunk/README.txt

    r1448 r1450  
    44Information about Fortress can be found at the following web site: 
    55 
    6   http://projectfortress.sun.com 
     6    http://projectfortress.sun.com 
    77 
    88If you have Subversion installed, you can check out the Fortress 
     
    1010and issuing the following command: 
    1111 
    12   svn checkout https://projectfortress.sun.com/svn/Community/trunk PFC 
     12    svn checkout https://projectfortress.sun.com/svn/Community/trunk PFC 
    1313 
    1414(The name "PFC" merely specifies the name of the directory you want 
     
    3333it from your .emacs file with the following command: 
    3434 
    35   (load (concat (getenv "FORTRESS_HOME") 
    36                 "/Fortify/fortify.el")) 
     35    (load (concat (getenv "FORTRESS_HOME") 
     36                  "/Fortify/fortify.el")) 
    3737 
    3838SpecData: Machine-readable files used by the Fortress Language 
     
    8686script: 
    8787 
    88   JAVA_HOME 
    89   ANT_HOME 
     88    JAVA_HOME 
     89    ANT_HOME 
    9090 
    9191(Although our scripts are sometimes able to guess the locations of 
     
    9595by going to the directory $FORTRESS_HOME and typing the command: 
    9696 
    97   ./ant clean test 
     97    ./ant clean test 
    9898 
    9999If that doesn't work, there's a bug in the interpreter; please issue a 
     
    104104command line: 
    105105 
    106   fortress compile somefile.fs{s,i} 
    107   fortress [run] [-test] [-debug] somefile.fss arg... 
    108   fortress help 
     106    fortress compile somefile.fs{s,i} 
     107    fortress [run] [-test] [-debug] somefile.fss arg... 
     108    fortress help 
    109109 
    110110A command of the form "fortress compile somefile.fss" or 
     
    287287and online at: 
    288288 
    289 http://projectfortress.sun.com 
     289    http://projectfortress.sun.com 
    290290 
    291291Each example in the specification is automatically generated from 
     
    347347Fortress program is run. 
    348348 
     349 
    349350BUILT-IN TYPES 
    350351 
    351352There are a bunch of types that are defined internally by the Fortress 
    352 interpreter.  With the exception of Any these cannot be overridden. 
     353interpreter.  With the exception of Any, these cannot be overridden. 
    353354The built-in types are found in 
    354355ProjectFortress/LibraryBuiltin/FortressBuiltin.fsi and 
     
    362363 
    363364Note that there isn't (yet) a trait Object!  Eventually user-written 
    364 trait and object declarations will extend Object by default; right now 
     365trait and object declarations will extend Object by default; right now, 
    365366they instead extend Any by default.  We plan to migrate to a new 
    366367infrastructure for primitive objects (based on the one used for 
     
    371372found in Library/FortressLibrary.fsi; again these primitive are 
    372373documented in the specification as well.  Note in particular that in 
    373 the absence of coercion you may occasionally need to make use of widen 
     374the absence of coercion, you may occasionally need to make use of widen 
    374375and narrow to convert between ZZ32 and ZZ64. 
     376 
    375377 
    376378LIBRARY HIGH POINTS 
     
    378380Your best guide to library functionality is the library code itself; 
    379381this can be found in Library/ and in ProjectFortress/LibraryBuiltin. 
    380 The apis for these libraries can also be found in the language 
     382The APIs for these libraries can also be found in the language 
    381383specification (note, though, that if you downloaded the latest version 
    382384of the Fortress implementation then the two may differ).  This section 
     
    389391Several functions attempt to convert data of type Any to a string. 
    390392These include print(), println(), assert(), and juxtaposition of Any 
    391 with a string.  Right now the FortressBuiltin types are printed using 
     393with a string.  Right now, the FortressBuiltin types are printed using 
    392394internal magic, and object types are printed using the toString 
    393 getter.  The consequence of this is that you will see a run time error 
     395method.  The consequence of this is that you will see a runtime error 
    394396if you attempt to print an object without first defining a toString 
    395397method. 
     
    425427    a = array[\T\](size).fill(fn (index:ZZ32) => ...) 
    426428 
    427 At the moment to create a non-0-indexed array you need to create a 
     429At the moment, to create a non-0-indexed array you need to create a 
    428430correctly-sized 0-indexed array as described above, then use the 
    429431shift(newlower) method to shift the lower index.  Thus, to create an 
     
    435437first.  It creates a fresh array whose element type is T but whose 
    436438bounds are the same as the bounds of the array being replicated.  When 
    437 data distribution is fully implemented is should respect that as well. 
     439data distribution is fully implemented, it should respect that as well. 
    438440It is a bit like saying array[\T\](a.bounds().upper()) for 0-indexed 
    439441arrays but is slightly more graceful and deals well with non-0-indexed 
     
    442444You can convert any array to use 0 indexing simply by indexing it with 
    443445an empty range: 
    444 a[:] or a[#]  ==>  a, only 0-indexed. 
     446    a[:] or a[#]  ==>  a, only 0-indexed. 
    445447 
    446448Any operation that yields a subarray of an underlying array shares 
     
    449451To assign the contents of array a to array b, you can use: 
    450452 
    451 a.assign(b) 
    452  
    453 If a is freshly allocated.  The following should work all the time: 
    454  
    455 a[:] := b[:] 
     453    a.assign(b) 
     454 
     455if a is freshly allocated.  The following should work all the time: 
     456 
     457    a[:] := b[:] 
    456458 
    457459Right now type-level ranges don't really exist, so if you want to 
    458 operate on subarrays with statically type-checked bounds you'll need 
     460operate on subarrays with statically type-checked bounds, you'll need 
    459461to work with the subarray method: 
    460462 
    461   subarray[\nat b, nat s, nat o\]():Array1[\T, b, s\] 
     463    subarray[\nat b, nat s, nat o\]():Array1[\T, b, s\] 
    462464 
    463465This returns a structure-sharing subarray with base b and size s 
    464466starting from offset o in the current array. 
    465467 
    466 The special factory functions vector and matrix are restricted to numeric argument 
    467 types and static dimensionality: 
    468  
    469 x' : ZZ64[1000] = vector[\ZZ64,1000\](17) 
     468The special factory functions vector and matrix are restricted to numeric 
     469argument types and static dimensionality: 
     470 
     471    x' : ZZ64[1000] = vector[\ZZ64,1000\](17) 
    470472 
    471473At the moment, any Array1 or Array2 whose element type extends Number 
     
    475477will eventually be replaced by opr ()^T. 
    476478 
     479 
    477480GENERATORS, REDUCTIONS, and COMPREHENSIONS 
    478481 
    479482Defining new generators is discussed in detail in the Fortress 
    480483language specification, but if you're trying it yourself for the first 
    481 time you may find it instructive to browse the source code of the libraries. 
     484time, you may find it instructive to browse the source code of the libraries. 
     485 
    482486 
    483487DEFINING NEW PRIMITIVE FUNCTIONS 
     
    491495an integer: 
    492496 
    493 opr |\a:RR64/|:ZZ64 = builtinPrimitive("glue.prim.Float$IFloor") 
     497    opr |\a:RR64/|:ZZ64 = builtinPrimitive("glue.prim.Float$IFloor") 
    494498 
    495499You should *not* mention the type parameter to builtinPrimitive when 
     
    500504non-user-friendly error messages when the Java code is run. 
    501505 
     506 
    502507DEFINING NEW PRIMITIVE CLASSES 
    503508 
     
    522527 
    523528 
    524 Note that we import a non-native component that define traits 
     529Note that we import a non-native component that defines traits 
    525530mentioned in the extends clause.  The first two bindings must be 
    526531language and package in that order; right now only language="java" is