Commit Graph

3207 Commits (763d9a3f7dbac882cff1b03bc674b36098c68a48)

Author SHA1 Message Date
Doug Coleman df64529fb5 Forget some classes after unit tests so that running "classes" test succeeds multiple times in a row 2011-10-24 16:59:46 -07:00
John Benediktsson ea4fe562c3 vocabs.loader: actually use the root cache. 2011-10-24 16:19:59 -07:00
Doug Coleman f9257959fd Rename class to class-of 2011-10-24 06:47:42 -05:00
Doug Coleman 26872ffe4d Rename vocab to lookup-vocab 2011-10-24 06:42:54 -05:00
Doug Coleman 3d65fbf1c7 Remove docs for removed word 2011-10-24 00:57:14 -05:00
Doug Coleman 2ecd513130 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
2011-10-23 19:59:01 -05:00
John Benediktsson 5a943b32c4 Remove stack effects from HELP: declarations. 2011-10-20 19:36:11 -07:00
John Benediktsson beb5b9bf64 hash-sets: separate <hash-set> and >hash-set to match other containers. Fixes #154. 2011-10-19 11:35:25 -07:00
John Benediktsson f4a6e10818 More cleanup of unused stuff. 2011-10-19 11:01:16 -07:00
John Benediktsson d1f5fefab0 Cleanup some uses of global [ ] bind. 2011-10-19 11:01:16 -07:00
Doug Coleman c5cca8a6c6 Forgot using in io.tests 2011-10-19 01:16:41 -07:00
Doug Coleman 0e46502f6e Add with-error>output word and test 2011-10-19 00:56:11 -07:00
John Benediktsson e648ce70bb system: fix stack effect for exit in docs. 2011-10-18 20:03:19 -07:00
Joe Groff 13b17fb84a io: input-stream and output-stream mixins 2011-10-18 16:25:09 -07:00
Joe Groff d61f335fee 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
2011-10-18 15:13:33 -07:00
John Benediktsson 80e1c8e3f2 Eliminate duplicate syntax for stack effects "(" no longer drops and is identical to the old "((", which is now removed. 2011-10-18 13:19:39 -07:00
Joe Groff 4493d66282 io.encodings.utf16: auto-use strikes again 2011-10-17 21:46:08 -07:00
Joe Groff 67cccc63b3 formatting 2011-10-17 21:23:36 -07:00
Joe Groff 5443664df7 io.encodings.utf16: guess-*coded-length hints 2011-10-17 21:23:11 -07:00
Joe Groff 4bdef412fc 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.
2011-10-17 21:23:11 -07:00
Joe Groff aa36db5ca8 io.streams.sequence: missed a USING: 2011-10-17 21:23:10 -07:00
Joe Groff cd0eb76806 io: remove higher-order stack effects
More stack checker breakage
2011-10-17 21:23:10 -07:00
Joe Groff 0353179a92 io.streams.c: remove -seek and -tell methods
M: c-stream stream-seek was broken and bootstrap doesn't need it so save some code.
2011-10-17 21:23:10 -07:00
Joe Groff e426512534 more stream-seekable? and stream-length methods
- limited-streams and throw-on-eof-streams
- string-readers and byte-readers
2011-10-17 21:23:09 -07:00
Joe Groff 1b0b765e82 io: document new words 2011-10-17 21:23:09 -07:00
Joe Groff 3588e6e4dc io.streams.c: help-lint 2011-10-17 21:23:08 -07:00
Joe Groff 4d224b552f io: stream-read-into and stream-read-partial-into
Safe user-facing wrappers for stream-read-unsafe.
2011-10-17 21:23:08 -07:00
Joe Groff 5627492f9b io.encodings: stream-contents method for decoder
stream-contents on decoder is much faster implemented using a read1 loop than with the default implementation.
2011-10-17 21:23:07 -07:00
Joe Groff 225d10b4dd 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.
2011-10-17 21:23:07 -07:00
Joe Groff 1c85631611 io: get variables out of stream-copy loop 2011-10-17 21:23:07 -07:00
Joe Groff 09f55f82fa 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.
2011-10-17 21:23:06 -07:00
Joe Groff 805b0372da 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.
2011-10-17 21:23:06 -07:00
Joe Groff aaec2eb1ac 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.
2011-10-17 21:23:05 -07:00
Joe Groff 6f12322bda 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.
2011-10-17 21:23:05 -07:00
Joe Groff d2855bbf09 io: remove each-block* because it's not useful 2011-10-17 21:23:03 -07:00
Joe Groff 5e2d95ebb2 io.encodings: decoders can't really seek or tell 2011-10-17 21:23:03 -07:00
Joe Groff 73b6648b0e io.encodings: re-encrypt into stack-ese for core 2011-10-17 21:23:03 -07:00
Joe Groff 008ef0afd7 io.encodings: read-unsafe for decoders†
† currently uses locals, so not bootstrappable
2011-10-17 21:23:02 -07:00
Joe Groff ffacdaf0da io.encodings: encoded/decoded length hints
Add guess-encoded-length and guess-decoded-length generics that encodings can implement to provide hints as to how large the translation product will be, for sizing vectors and things like that.
2011-10-17 21:23:02 -07:00
Joe Groff 9082d05582 io: tweak each-block* to be byte- or char-agnostic 2011-10-17 21:23:02 -07:00
Joe Groff d54824cb40 io: nab io.streams.peek's stream-exemplar-growable
Rename stream-element-examplar to stream-exemplar to match.
2011-10-17 21:23:01 -07:00
Joe Groff 8261c941c2 io: non-copying each-block and contents variants
each-(stream-)block* is like each-block but takes a buffer object and reads into it repeatedly. (stream-)contents* determines the stream length then does a single stream-read-unsafe into a preallocated buffers. Both functions currently only work for byte-arrays (and contents* only for seekable streams), so they can't replace the non-starred versions completely just yet.
2011-10-17 21:23:00 -07:00
Joe Groff b79d7158be io.streams.memory: implement stream-read-unsafe
(The actual method is in alien.data due to bootstrap load order issues.)
2011-10-17 21:22:59 -07:00
Joe Groff d5f4b6f155 io.streams.sequence: change to provide read-unsafe
Change io.streams.sequence and its children io.streams.byte-array and io.streams.string to implement the -unsafe protocol and mixin noncopying-reader.
2011-10-17 21:22:59 -07:00
Joe Groff 66bb07bbcf io, io.streams.c: factor noncopying-reader mixin
Instances of the mixin implement stream-read and stream-read-partial in terms of stream-read-unsafe and stream-read-partial-unsafe, respectively.
2011-10-17 21:22:58 -07:00
Joe Groff 2518f1c0e9 io.streams.c: Document fputc primitive 2011-10-17 21:22:58 -07:00
Joe Groff 5a072c57a6 bootstrap, io.streams.c: use new fread primitive
Change the fread primitive to fread-unsafe, matching the new primitive in the VM, and update the implementation of c-reader to implement stream-read-unsafe and stream-read in terms of fread-unsafe
2011-10-17 21:22:58 -07:00
Joe Groff ef8a179f34 io: non-copying binary stream read generics
Add generics stream-read-unsafe and stream-read-partial-unsafe, which take a buffer pointer and return a count of bytes read instead of returning a freshly allocated byte array.
2011-10-17 21:22:57 -07:00
Doug Coleman f21fee3b73 Rename complete-effect to scan-effect 2011-10-17 10:25:27 -07:00
John Benediktsson 81714b8dc3 More lint cleanups. 2011-10-16 19:33:16 -07:00