Factor 0.80 is out
Monday, January 30, 2006
Factor 0.80 is now available.
- New help system, browsable in the UI and via the HTTP server
(
/responder/help). In the UI listener, invokehandbookto read the documentation root, and invoke\ foo helpto look at documentation for the wordfoo. - Sequences:
- Association list words
assoc*,set-assoc,aconsandremove-assocare gone. - The
repeatedvirtual sequence type is gone. Instead, the<array>word takes an initial element in addition to an initial size. - The
fillword to create a new string with an initial character repeated a certain number of times has been renamed to<string>. - Add a new
interleave ( seq quot between -- )combinator that applies a quotation to each element of a sequence, calling another quotation in between each pair. - Add a new
<=> ( obj1 obj2 -- n )word for comparing two objects using an intrinsic order. For numbers this is the standard order, for strings this is lexicographic order, and for words, this compares word names. - The
natural-sort ( seq -- seq )word replacesnumber-sort,string-sortandword-sort.
- Association list words
- Hashtables:
hash* ( key hash -- [[ key value ]] )is nowhash* ( key hash -- value ? )hash-clearis nowclear-hashhash-each,hash-each-with,hash-all?,hash-all-with?,hash-subset,hash-subset-withnow pass the key and value separately on the stack to the given quotation, instead of passing a cons cell- Literal syntax change:
H{ [[ key value ]] ... }is nowH{ { key value } }
- Math:
- The
sumandproductwords have been moved tocontrib/math/. - The
modword is now supported for ratios and floating point numbers. - The
truncate,floorandceilingwords are now supported for floating point numbers. - The NaN, positive infinity and negative infinity floating point
numbers now parse and unparse as
0.0/0.0,1.0/0.0, and-1.0/0.0respectively. - The NaN value is now equal to itself under
=. - Negative and postive zero are no longer equal under
=. However, the newzero?word tests if the top of the stack is a zero, and it tests for both positive and negative zero.
- The
- Streams:
stream-format ( string style stream -- )now takes a hashtable rather than an association list for specifying style information.stream-writeandstream-terpriare now generic words, and there is a newwith-nested-streamgeneric word. You can wrap your output streams in a<plain-writer>to avoid implementing these.
- C library interface:
-
Some alien word changes:
<foo> ==> "foo" <c-object> <foo-array> ==> "foo" <c-array> -
Support for binding to Objective C libraries is now included.
- Normal usage of Objective C classes and methods is done
using the
OBJC-CLASS:andOBJC-MESSAGE:parsing words. See the example inexamples/cocoa-speech.factor. - Objective C runtime introspection functions and structures
are defined in the
objective-cvocabulary.
- Normal usage of Objective C classes and methods is done
using the
-
Added a pair of words for between Factor strings and C strings,
alien>stringandstring>alien.
-
Compiler changes:
- AMD64 compiler backend.
- Fixed some problems with compilation of inlined recursive words.
UI changes:
- Fixed invalid OpenGL calls which caused problems on Windows machines with ATI drivers, and Linux machines with the MesaGL implementation.
- The listener looks different now. An expandable top area is used for browsing objects, words and help, and the stack display has been shrunk to a single status line at the bottom of the window.
- A left click on a presentation now invokes the default command. A right click shows a menu of possibilities.
Bootstrap changes:
-
Source files are no longer loaded in the stage-2 bootstrap. Since stage-2 bootstrap runs in the interpreter, this reduces bootstrap time by a few minutes. Instead, all source files, including the compiler backend, are loaded in stage-1 bootstrap, and thus boot images are now CPU-specific. Boot images can be created as follows:
USE: image "x86" make-image "ppc" make-image "amd64" make-image
Contributed libraries:
- All libraries in
contrib/have been tested and updated for recent language changes, and you can runcontrib/load.factorto load all of them at once (Trent Buck) - Updated
contrib/x11/with many more examples (Eduardo Cavazos) - Added splay tree library in
contrib/splay-trees.factor(Mackenzie Straight) - Improved AJAX support in
contrib/httpd/. The “prototype” JavaScript library is now included (Chris Double)