map, 2each and 2mapfixnum-shift, fixnum/i overflow.foldable, eg:
: cube dup dup * * ; foldable
1 * are optimized out.
sort ( seq quot -- | quot: elt elt -- -1/0/1 ) combinator now works with any sequence, not just a list. The comparator also has to return a signed integer, not just a boolean. It is much faster than the old sorting algorithm.binsearch ( elt seq quot -- i | quot: elt elt -- -1/0/1 ) and binsearch ( elt seq quot -- elt | quot: elt elt -- -1/0/1 ) combinators perform a binary search on a sorted sequence.2each ( seq seq quot -- quot: elt -- elt ) combinatorjoin ( seq glue -- seq ) word. Takes a sequence of sequences, and constructs a new sequence with the glue in between each sequence. For example:
[ "usr" "bin" "grep" ] "/" join "usr/bin/grep"
count ( n -- [ 0 ... n-1 ] ) word is gone; just use >vector instead. Also, project has been made redundant by map.seq-transpose ( seq -- seq ) word is now named flip.
math vocabulary.make-hash ( quot -- namespace ) combinator executes quotation in a new namespace, which is then pushed on the stack.<namespace> word is gone. It would create a hashtable with a default capacity. Now, just write {{ }} clone.
make-list ==> [ ] make
make-vector ==> { } make
make-string ==> "" make
make-rstring ==> "" make reverse
make-sbuf ==> SBUF" " make
every? word has been replaced with monotonic? ( seq quot -- ? ). Its behavior is a superset of every? -- it now accepts any transitive relation, and checks if the sequence is monotonic under this relation. For example,
[ = ] monotonic? checks if all elements in a sequence are equal, and [ < ] monotonic? checks for a strictly increasing sequence of integers.unparse ( object -- string ) word has been moved to the prettyprint vocabulary, and can now produce a parsable string for any class supported by the prettyprinter.unparse-short ( object -- string ) returns a string no longer than a single line.profile ( word -- ) word. Causes the word's accumulative runtime to be stored in a global variable named by the word. This is done with the annotation facility, the word's definition is modified; use reload ( word -- ) to get the old definition back from the source file.sleep ( ms -- ) word pauses current thread for a number of milliseconds.with-datastack ( stack word -- stack ) combinator.cond ( conditions -- ) combinator. It behaves like a set of nested iftes, and compiles if each branch has the same stack effect. See its documentation comment for details.G: syntax) in handbook.contrib/concurrency (Chris Double).contrib/algebra/. Now, vector operations are possible
and the syntax doesn't use so many spaces. New way to write the quadratic formula:
MATH: quadratic[a;b;c] =
plusmin[(-b)/2*a;(sqrt(b^2)-4*a*c)/2*a] ;
(Daniel Ehrenberg)all? ( seq quot -- ? | quot: elt -- ? ) all-with? ( obj seq quot -- ? | quot: elt -- ? ) subset ( seq quot -- seq | quot: elt -- ? ) subset-with ( obj seq quot -- seq | quot: obj elt -- ? ) fiber? ( seq quot -- ? | quot: elt elt -- ? ) prune ( seq -- seq )
contains? word for testing membership in a sequence has been
renamed to member? ( elt seq -- ? ).
some? and some-with? combinators are gone. Their replacements are generic:
contains? ( seq quot -- ? | quot: elt -- ? ) contains-with? ( obj seq quot -- ? | quot: obj elt -- ? ) find ( seq quot -- i elt | quot: elt -- ? ) find* ( i seq quot -- i elt | quot: elt -- ? ) find-with ( obj seq quot -- i elt | quot: elt -- ? ) find-with* ( obj i seq quot -- i elt | quot: elt -- ? )See the developer's handbook for details.
nreverse ( seq -- ) word has been removed.
reverse-slice ( seq -- seq ) outputs a new sequence that shares
structure with the given sequence, but presents elements in reverse
order.
string-compare primitive has been replaced with the lexi word
which now operates on any pair of sequences of numbers. The
string> word has been replaced with lexi>.
, word no longer accepts a string as input inside a make-string. In 0.75, the following
two lines were equivalent:
[ "Hello" , " world" , ] make-string [ "Hello" % " world" % ] make-string
, with characters, and % with
strings inside make-string.
stream-auto-flush ==> stream-finish ( stream -- ) stream-write-attr ==> stream-format ( string style stream -- ) write-attr ==> format ( string style -- )
stream-format ( string style stream -- ) format ( string style -- ) stream-write ( string stream -- ) write ( string -- ) stream-print ( string -- ) print ( string -- )
stream-write1 ( char stream -- ) write1 ( char -- )Note that
stream-write1 is generic and your stream must implement it.
with-string word renamed to string-out ( quot -- string )
string-in ( string quot -- ) word, calls quot with stdio bound to
a stream that reads from the given string.
inspect ( obj -- ).
contrib/crypto/ (Doug Coleman).