Changeset 1450
- Timestamp:
- 03/31/08 13:37:28 (3 months ago)
- Files:
-
- trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/Init.java (modified) (6 diffs)
- trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeDynamic.java (deleted)
- trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTuple.java (modified) (1 diff)
- trunk/README.txt (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/Init.java
r1408 r1450 22 22 import com.sun.fortress.interpreter.evaluator.types.FTypeBufferedWriter; 23 23 import com.sun.fortress.interpreter.evaluator.types.FTypeChar; 24 import com.sun.fortress.interpreter.evaluator.types.FTypeDynamic;25 24 import com.sun.fortress.interpreter.evaluator.types.FTypeFloat; 26 25 import com.sun.fortress.interpreter.evaluator.types.FTypeFloatLiteral; … … 54 53 // For leak detection. 55 54 static int countdown=4; 56 55 57 56 public static void initializeEverything() { 58 57 FTypeArrow.reset(); … … 67 66 FTypeVoid.ONLY.resetState(); 68 67 FTypeTop.ONLY.resetState(); 69 FTypeDynamic.ONLY.resetState();70 68 71 69 FTypeBufferedWriter.ONLY.resetState(); … … 82 80 FTypeString.ONLY.resetState(); 83 81 FTypeStringLiteral.ONLY.resetState(); 84 82 85 83 BottomType.ONLY.resetState(); 86 84 FTypeRange.ONLY.resetState(); … … 89 87 FTypeFloatLiteral.ONLY.resetState(); 90 88 FTypeStringLiteral.ONLY.resetState(); 91 89 92 90 NativeApp.reset(); 93 91 … … 99 97 Thread.sleep(1000000000); 100 98 } catch (InterruptedException ex) { 101 99 102 100 } 103 101 } 104 102 105 103 } 106 104 trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTuple.java
r1442 r1450 142 142 * omitted type information in 143 143 * 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); 145 146 } else { 146 147 return true; trunk/README.txt
r1448 r1450 4 4 Information about Fortress can be found at the following web site: 5 5 6 http://projectfortress.sun.com6 http://projectfortress.sun.com 7 7 8 8 If you have Subversion installed, you can check out the Fortress … … 10 10 and issuing the following command: 11 11 12 svn checkout https://projectfortress.sun.com/svn/Community/trunk PFC12 svn checkout https://projectfortress.sun.com/svn/Community/trunk PFC 13 13 14 14 (The name "PFC" merely specifies the name of the directory you want … … 33 33 it from your .emacs file with the following command: 34 34 35 (load (concat (getenv "FORTRESS_HOME")36 "/Fortify/fortify.el"))35 (load (concat (getenv "FORTRESS_HOME") 36 "/Fortify/fortify.el")) 37 37 38 38 SpecData: Machine-readable files used by the Fortress Language … … 86 86 script: 87 87 88 JAVA_HOME89 ANT_HOME88 JAVA_HOME 89 ANT_HOME 90 90 91 91 (Although our scripts are sometimes able to guess the locations of … … 95 95 by going to the directory $FORTRESS_HOME and typing the command: 96 96 97 ./ant clean test97 ./ant clean test 98 98 99 99 If that doesn't work, there's a bug in the interpreter; please issue a … … 104 104 command line: 105 105 106 fortress compile somefile.fs{s,i}107 fortress [run] [-test] [-debug] somefile.fss arg...108 fortress help106 fortress compile somefile.fs{s,i} 107 fortress [run] [-test] [-debug] somefile.fss arg... 108 fortress help 109 109 110 110 A command of the form "fortress compile somefile.fss" or … … 287 287 and online at: 288 288 289 http://projectfortress.sun.com289 http://projectfortress.sun.com 290 290 291 291 Each example in the specification is automatically generated from … … 347 347 Fortress program is run. 348 348 349 349 350 BUILT-IN TYPES 350 351 351 352 There are a bunch of types that are defined internally by the Fortress 352 interpreter. With the exception of Any these cannot be overridden.353 interpreter. With the exception of Any, these cannot be overridden. 353 354 The built-in types are found in 354 355 ProjectFortress/LibraryBuiltin/FortressBuiltin.fsi and … … 362 363 363 364 Note that there isn't (yet) a trait Object! Eventually user-written 364 trait and object declarations will extend Object by default; right now 365 trait and object declarations will extend Object by default; right now, 365 366 they instead extend Any by default. We plan to migrate to a new 366 367 infrastructure for primitive objects (based on the one used for … … 371 372 found in Library/FortressLibrary.fsi; again these primitive are 372 373 documented in the specification as well. Note in particular that in 373 the absence of coercion you may occasionally need to make use of widen374 the absence of coercion, you may occasionally need to make use of widen 374 375 and narrow to convert between ZZ32 and ZZ64. 376 375 377 376 378 LIBRARY HIGH POINTS … … 378 380 Your best guide to library functionality is the library code itself; 379 381 this can be found in Library/ and in ProjectFortress/LibraryBuiltin. 380 The apis for these libraries can also be found in the language382 The APIs for these libraries can also be found in the language 381 383 specification (note, though, that if you downloaded the latest version 382 384 of the Fortress implementation then the two may differ). This section … … 389 391 Several functions attempt to convert data of type Any to a string. 390 392 These include print(), println(), assert(), and juxtaposition of Any 391 with a string. Right now the FortressBuiltin types are printed using393 with a string. Right now, the FortressBuiltin types are printed using 392 394 internal magic, and object types are printed using the toString 393 getter. The consequence of this is that you will see a runtime error395 method. The consequence of this is that you will see a runtime error 394 396 if you attempt to print an object without first defining a toString 395 397 method. … … 425 427 a = array[\T\](size).fill(fn (index:ZZ32) => ...) 426 428 427 At the moment to create a non-0-indexed array you need to create a429 At the moment, to create a non-0-indexed array you need to create a 428 430 correctly-sized 0-indexed array as described above, then use the 429 431 shift(newlower) method to shift the lower index. Thus, to create an … … 435 437 first. It creates a fresh array whose element type is T but whose 436 438 bounds are the same as the bounds of the array being replicated. When 437 data distribution is fully implemented isshould respect that as well.439 data distribution is fully implemented, it should respect that as well. 438 440 It is a bit like saying array[\T\](a.bounds().upper()) for 0-indexed 439 441 arrays but is slightly more graceful and deals well with non-0-indexed … … 442 444 You can convert any array to use 0 indexing simply by indexing it with 443 445 an empty range: 444 a[:] or a[#] ==> a, only 0-indexed.446 a[:] or a[#] ==> a, only 0-indexed. 445 447 446 448 Any operation that yields a subarray of an underlying array shares … … 449 451 To assign the contents of array a to array b, you can use: 450 452 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 455 if a is freshly allocated. The following should work all the time: 456 457 a[:] := b[:] 456 458 457 459 Right now type-level ranges don't really exist, so if you want to 458 operate on subarrays with statically type-checked bounds you'll need460 operate on subarrays with statically type-checked bounds, you'll need 459 461 to work with the subarray method: 460 462 461 subarray[\nat b, nat s, nat o\]():Array1[\T, b, s\]463 subarray[\nat b, nat s, nat o\]():Array1[\T, b, s\] 462 464 463 465 This returns a structure-sharing subarray with base b and size s 464 466 starting from offset o in the current array. 465 467 466 The special factory functions vector and matrix are restricted to numeric argument467 types and static dimensionality:468 469 x' : ZZ64[1000] = vector[\ZZ64,1000\](17)468 The special factory functions vector and matrix are restricted to numeric 469 argument types and static dimensionality: 470 471 x' : ZZ64[1000] = vector[\ZZ64,1000\](17) 470 472 471 473 At the moment, any Array1 or Array2 whose element type extends Number … … 475 477 will eventually be replaced by opr ()^T. 476 478 479 477 480 GENERATORS, REDUCTIONS, and COMPREHENSIONS 478 481 479 482 Defining new generators is discussed in detail in the Fortress 480 483 language 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. 484 time, you may find it instructive to browse the source code of the libraries. 485 482 486 483 487 DEFINING NEW PRIMITIVE FUNCTIONS … … 491 495 an integer: 492 496 493 opr |\a:RR64/|:ZZ64 = builtinPrimitive("glue.prim.Float$IFloor")497 opr |\a:RR64/|:ZZ64 = builtinPrimitive("glue.prim.Float$IFloor") 494 498 495 499 You should *not* mention the type parameter to builtinPrimitive when … … 500 504 non-user-friendly error messages when the Java code is run. 501 505 506 502 507 DEFINING NEW PRIMITIVE CLASSES 503 508 … … 522 527 523 528 524 Note that we import a non-native component that define traits529 Note that we import a non-native component that defines traits 525 530 mentioned in the extends clause. The first two bindings must be 526 531 language and package in that order; right now only language="java" is
