Commit Graph

563 Commits (1d8449115ccd091c03ce46445aa42a3d29c0c333)

Author SHA1 Message Date
otoburb 30d8b5211e io.pathnames: removed dependency on environment.
I had an erroneous dependency on basis/environment.
2012-03-30 21:03:01 -07:00
otoburb 152c301d49 io.pathnames: Revised ~ support to expand on the first tilde, and not on "~/".
This mimics the same behaviour as "ls ~" in the shell, which expands the alias
as a directory, and not as a filename. For the specific edge-case where a
filename called "~" must have a path constructed to it (e.g. "./~" or "~/~").
2012-03-30 21:01:57 -07:00
otoburb cb6eb8b2bd io.pathnames: Added ~/ (tilde) prefix recognition as a special pathname.
vocab:, resource: and ~/ are special pathnames. Modified absolute-path word,
added test cases and updated io.pathname documentation.
2012-03-30 21:01:46 -07:00
Joe Groff 83a3a0346b io.files: check argv when initing resource-path 2012-03-27 16:58:12 -07:00
Joe Groff 0ddb6fa96e Revert "io.pathnames: Added ~/ (tilde) prefix recognition as a special pathname."
This reverts commit 4e10f09787.
2012-01-31 11:46:02 -08:00
Joe Groff af8dc62104 Revert "io.pathnames: Revised ~ support to expand on the first tilde, and not on "~/"."
This reverts commit 251a2a19a6.
2012-01-31 11:45:51 -08:00
otoburb dc11f2d7a2 io.pathnames: Revised ~ support to expand on the first tilde, and not on "~/".
This mimics the same behaviour as "ls ~" in the shell, which expands the alias
as a directory, and not as a filename. For the specific edge-case where a
filename called "~" must have a path constructed to it (e.g. "./~" or "~/~").
2012-01-11 02:36:47 +00:00
otoburb a5e8cc75b9 io.pathnames: Added ~/ (tilde) prefix recognition as a special pathname.
vocab:, resource: and ~/ are special pathnames. Modified absolute-path word,
added test cases and updated io.pathname documentation.
2012-01-11 02:36:47 +00:00
Doug Coleman 3ba787b277 core/basis: trim down using lists 2011-11-30 23:15:42 -08:00
Joe Groff 78d23ce6a0 io: implement stream protocols on f
Fixes deployed applications that write to output-stream
2011-11-28 20:36:34 -08:00
Joe Groff 1d9838aa57 io.files: back out resource-path change
It's too brittle against varying current directories or the Factor directory being moved.
2011-11-27 12:37:58 -08:00
Joe Groff 88c9483343 io.files: use initialize to set resource-path
If a resource path is already set in the image, don't change it. Should make #364 work a bit more as expected, and let us set the resource path for deployed Mac OS X bundles.
2011-11-27 12:37:58 -08:00
Joe Groff 943596575a use radix literals 2011-11-23 19:03:40 -08:00
Joe Groff 0cf0b91aad io: clean up some mess 2011-11-09 19:11:04 -08:00
Joe Groff b4947a62f6 io: fix each-block-slice typo 2011-11-09 18:06:58 -08:00
Joe Groff 4f4bbd3304 io: more hot-rodding for #376
* Change the interface of read-into to return a slice and an eof boolean separately so the compiler can optimize the slice.
* Add an each-stream-block-slice combinator that behaves like each-block but reuses a preallocated buffer for every iteration.
* Pull some strings in the stream-read-into implementation to further improve type propagation and bounds check elimination.
2011-11-09 17:22:01 -08:00
Joe Groff 5a3537b90a io.files: add file-reader, file-writer mixins
This lets us do some trickery so that the stream-element-type propagates from <file-reader>/<file-writer>. For #376.
2011-11-09 14:43:39 -08:00
Joe Groff f31fb8a968 io:read: don't resize output buffer if unnecessary
Even with a short-circuit test in the VM primitives, resize still has an overly high runtime cost in tight loops. For #376.
2011-11-09 14:29:12 -08:00
Doug Coleman c731dc6edb Rename lookup to lookup-word. 2011-11-06 16:00:00 -08:00
Joe Groff 186bf65a00 constants for special object hardcoded literals 2011-11-02 12:54:50 -07:00
Joe Groff 1386212d23 vm: dispatch signal handlers through subprimitive
We also need to save C ABI volatile registers before calling the signal handler in order to be able to reliably resume. Add signal-handler and leaf-signal-handler subprimitives to preserve volatile registers before invoking the signal handler C function.
2011-10-27 21:18:18 -07:00
Doug Coleman 7b6f27eda6 Add a lint check for swap .. swap that can be replaced by dip. Clean up the cases it finds. 2011-10-26 13:01:04 -07:00
Doug Coleman 1882e3de3e Use dip instead of swap swap for making file streams 2011-10-26 11:48:26 -07:00
Doug Coleman 51c033a1f6 Fix all failures in the linux64 build email 2011-10-24 19:33:09 -07:00
John Benediktsson 5a943b32c4 Remove stack effects from HELP: declarations. 2011-10-20 19:36:11 -07:00
John Benediktsson f4a6e10818 More cleanup of unused stuff. 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
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
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