Doug Coleman [Mon, 24 Oct 2011 00:05:22 +0000 (19:05 -0500)]
Factor out ``no-roots no-prefixes'' into its own word. Add load-root, load-from-root, vocabs-in-root and implement load in terms of load-from-root.
Add error checking for append-vocab-dir and (child-vocabs) in case someone tries to pass them the wrong parameters.
Rename: vocab-dir+ to append-vocab-dir
Document load-from-root and load-root
Doug Coleman [Wed, 19 Oct 2011 09:31:48 +0000 (02:31 -0700)]
When deleting a file, if it fails with "Access is denied" then set the file
attributes to normal and try again. Some files in the .git directory are set
to read-only, preventing the build machines from deleting old builds.
Joe Groff [Tue, 18 Oct 2011 22:13:02 +0000 (15:13 -0700)]
new vocab tools.annotations.assertions
Annotates unsafe words with assertions that their inputs and outputs are valid. Provide annotations for stream-read(-partial)-unsafe and (set-)nth-unsafe to start with.
Joe Groff [Tue, 18 Oct 2011 21:28:41 +0000 (14:28 -0700)]
io: error stream combinators
* with-error-stream(*)
* with-output+error-stream(*) -- sets output and error stream to same stream
* with-output>error -- sets output stream to error stream for scope
* with-input-output+error-streams(*) -- like with-streams, but sets output and error to same stream
Revert "Optimize byte-reverse macro in alien.endian -- it was shifting each byte to the 0th bit place, bitand-ing it with HEX: ff, then shifting it to its final destination -- now we immediately shift to the proper location and bitand with the proper bitmask."
Joe Groff [Mon, 17 Oct 2011 17:41:03 +0000 (10:41 -0700)]
io.sockets.windows: recv to byte-array via malloc
WSARecvFrom on Windows does its work asynchronously, so the buffer cannot be in the managed heap during the extent of the operation.
Joe Groff [Mon, 17 Oct 2011 02:37:21 +0000 (19:37 -0700)]
io.sockets: receive-unsafe and receive-into
Analogous to read-unsafe/read-into for streams (and thereby TCP sockets), provide receive-unsafe and receive-into words for datagram sockets that receive into a caller-supplied buffer.
Joe Groff [Sat, 15 Oct 2011 21:50:53 +0000 (14:50 -0700)]
io.encodings.utf16: fast path & slow path speedups
Implement M: utf16[bl]e encode-string to use a fast implementation if a string is ASCII only, and do some inlining so the slow path optimizes a bit better.
Joe Groff [Sat, 15 Oct 2011 06:24:36 +0000 (23:24 -0700)]
compiler.tree.dead-code: fix test
It was using "read" in an optimization test, but since "read" is now inline, it wasn't getting the expected optimized quotation back.
Joe Groff [Sat, 15 Oct 2011 01:08:27 +0000 (18:08 -0700)]
io.encodings: stream-contents method for decoder
stream-contents on decoder is much faster implemented using a read1 loop than with the default implementation.
Joe Groff [Sat, 15 Oct 2011 01:07:38 +0000 (18:07 -0700)]
io: stream-contents, -seekable?, -length generics
stream-contents is extremely slow on decoder streams when implemented with each-block, and it can be implemented very quickly for streams of known length using stream-read-unsafe. Make it generic and provide some off-the-shelf implementations using each-block, a read1 loop, or length + read-unsafe. Provide new stream-seekable? and stream-length generics that can be implemented by stream implementations that know their size.
Joe Groff [Fri, 14 Oct 2011 02:03:15 +0000 (19:03 -0700)]
clean up forwarding stream-read-partial-unsafe
Now that "io" provides a method on object for stream-read-partial-unsafe that forwards to stream-read-unsafe, individual stream class that don't implement partial reads don't need to provide such a method themselves.
Joe Groff [Fri, 14 Oct 2011 01:29:34 +0000 (18:29 -0700)]
io: default methods for extended stream protocols
Provide default implementations of all the input-stream methods in terms of stream-read1 and of all the output-stream methods in terms of stream-write1.
Joe Groff [Thu, 13 Oct 2011 22:24:28 +0000 (15:24 -0700)]
io.streams.peek: test with memory-stream
Some binary stream types use memcpy to implement read-unsafe, while element-agnostic wrapper streams have to use copy. Make sure peek-stream works with both when it has to divide a read between the peek buffer and the underlying buffer (it does).
Joe Groff [Thu, 13 Oct 2011 22:11:32 +0000 (15:11 -0700)]
specialized-arrays: direct-slice for byte-arrays
Implement nth-c-ptr and direct-like for byte-arrays so that direct-slice over a byte-array makes a uchar-array{ } over a part of the byte-array
Joe Groff [Thu, 13 Oct 2011 21:53:13 +0000 (14:53 -0700)]
io: add read-unsafe and read-partial-unsafe words
Add shortcut words to operate on the input-stream like the other stream methods have. Make all those words inline too just for fun.
Joe Groff [Thu, 13 Oct 2011 21:30:31 +0000 (14:30 -0700)]
kill noncopying-reader mixin, stream-read generic
Now that all streams have been updated to implement the stream-read-unsafe protocol, take out the noncopying-reader shim. Turn stream-read and stream-read-partial into plain functions over the -unsafe generics.