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
John Benediktsson
afc07c0e05
io.binary: make le> and be> faster (20% and 75%, respectively).
...
Removed primitive byte-array>bignum and digit_stream_to_bignum from vm/.
2011-10-11 21:13:30 -07:00
John Benediktsson
fec4cf9109
io.encodings.utf8: assume streams are largely ascii.
...
Results in 30% faster file-contents for test file and 7% faster benchmark.xml.
2011-10-03 21:49:21 -07:00
John Benediktsson
4f42c72012
specialized-arrays: performed some cleanup.
...
Specifically,
• Created >c-array to be replacement for >T-array.
• Created cast-array to be generic replacement for all T-array-cast words.
• Created c-array@ to be generic replacement for T-array@ words.
• Replaced usages of <T-array> with T <c-array>
• Replaced usages of <direct-T-array> with T <c-direct-array>
• Replaced usages of >T-array with T >c-array
• Replaced usages of T-array-cast with T cast-array
• Replaced usages of malloc-T-array with T malloc-array.
• Removed malloc-T-array.
• Removed T-array-cast.
• Removed T-array@.
• Removed >T-array.
I also added (but didn't change any code to use):
• T c-array-type, returns T-array
• T c-array?, returns T-array?
• c-array{ T ... }, returns T-array{ ... }
Bootstraps just find on Mac OS X. Also `load-all test-all` works for me.
2011-09-26 11:37:51 -07:00
Doug Coleman
1b20b0c476
Make sure 0 read always returns f. Fixes issue #70 .
...
More unit tests, fix read-until to return f f sometimes
Rename ((read-until)) to read-until-loop. Fix the stack effect declarations of (read) and handle-readln.
2011-09-09 18:51:06 -07:00
Slava Pestov
1c359f8d7a
io: fix help lint
2011-04-03 17:37:28 -07:00
John Benediktsson
f9ccaf37ec
io: improve stack effects.
2011-03-25 18:30:52 -07:00
John Benediktsson
3523d24785
io: implement "stream-contents" in terms of "each-stream-block".
2011-03-25 13:58:16 -07:00
John Benediktsson
69ec12c2dc
io: improve signature of each-block and each-line.
2011-03-25 12:20:51 -07:00
Keita Haga
ac67370e15
io.pathnames: enclose a few example outputs in double quote characters
2011-01-14 20:07:10 +09:00
Keita Haga
1aaa0409a1
continuations, io.binary: add whitespace between '"' and '{ $snippet' in the documentation
2011-01-08 22:26:06 +09:00
Keita Haga
d5fe4fecc1
remove useless whitespace in several documentation
2011-01-05 15:55:34 +09:00
Keita Haga
c1bca1e2c9
io: fix typo in docs
2011-01-04 18:12:43 +09:00
Slava Pestov
b0732bcb22
Fix unit test failures caused by alien.data change
2010-12-25 22:34:12 -08:00
Keita Haga
18811fb04a
io.pathnames: fix typo in docs
2010-11-28 00:47:59 +09:00
Slava Pestov
fbbaef70c4
Remove stream-peek and stream-peek1, re-implement dns vocab to not need this abstraction
2010-10-08 18:55:13 -07:00
Doug Coleman
d462355035
Implement and document stream-peek
2010-10-08 06:34:19 -07:00
Doug Coleman
f7af445625
Add stream-peek1 and remove it from images.gif and dns. Add sequence-peek but not stream-peek (yet?)
2010-10-08 06:34:17 -07:00
Slava Pestov
28eb59824d
io: fix with-streams to dispose the output stream first, move (stream-seek) word to io.streams.sequence where it belongs
2010-09-12 22:07:23 -07:00
Doug Coleman
fb9f1de3e4
Fix with-streams: if the first dispose throws an error, the second dispose never gets called
2010-09-12 00:26:14 -05:00
Doug Coleman
4b6946da45
Rename append-path-naive to append-relative-path, fix bugs to support Firefox FTP again
2010-09-05 00:40:47 -05:00
Doug Coleman
0ec1a89f54
If ftp clients send a path starting with /, treat it as a path relative to the serving directory. Expose absolute-path? and append-path-naive in io.pathnames to implement this change.
2010-09-04 22:16:57 -05:00
Slava Pestov
261e55a918
serialize, io.streams.byte-array: fix unit tests for utf8 encoding strictness
2010-08-25 17:51:44 -07:00
Slava Pestov
06f4934571
io.encodings.utf8: formatting fix
2010-08-25 17:47:26 -07:00
Joe Groff
c32760cc1d
io.encodings.utf8: also guard against decoding code points > 0x10FFFF
2010-08-25 09:28:39 -07:00
Joe Groff
fc6e308d7a
io.encodings.utf8: guard against decoding overlong encodings
2010-08-25 09:18:33 -07:00
Doug Coleman
e752b4ff62
Clean up vocabulary list, remove unused/poorly-named word from io
2010-07-09 13:32:09 -05:00
Slava Pestov
01d67104f6
io.ports: fix stream-seek with seek-relative seek type (reported by Joe Groff)
2010-07-07 17:32:30 -04:00
Slava Pestov
a7384d5de6
io.ports: fix stream-tell implementation
2010-07-07 02:27:34 -04:00
Slava Pestov
f31c579b7b
io.files: fix unit test
2010-05-19 20:47:22 -04:00
Slava Pestov
cb25591d36
io: missed a few byte-array>int-array in unit tests
2010-05-19 16:22:39 -04:00
Slava Pestov
627295f094
Language change: tuple slot setter words with stack effect ( value object -- ) are now named FOO<< instead of (>>FOO)
2010-05-06 17:21:02 -04:00
Slava Pestov
2eda6fc6aa
io.encodings: add a fast-path for ascii, utf8 and 8-bit encodings when string only contains ASCII characters
2010-04-19 01:14:00 -05:00
Slava Pestov
a3e6de5e6a
io.files: fix unit test for forget-tests? flag
2010-04-13 06:14:53 -07:00
Joe Groff
e7968ceffc
mop up compiler errors from macosx load-all
2010-03-09 00:56:07 -08:00
Slava Pestov
17b095a524
Slices over specialized arrays can now be passed to C functions, written to binary output streams, and given to malloc-byte-array
2010-02-25 04:50:31 +13:00
Slava Pestov
af0ddd5985
Specialized arrays, structs and other objects responding to the >c-ptr / byte-length protocol can now be written to binary streams
2010-02-24 20:18:41 +13:00
Joe Groff
e70fcf159d
Revert "fix append-path and vocab-dir to use path-separator"
...
This reverts commit 0f3026b871
.
2010-02-17 16:06:45 -08:00
Joe Groff
97654b67c1
Revert "io.pathnames: make absolute-path? public"
...
This reverts commit 48756c9fca
.
2010-02-17 16:06:30 -08:00
Joe Groff
1250a0fcfd
Revert "make io.pathnames tests path-separator-neutral"
...
This reverts commit f344c00629
.
2010-02-17 16:06:13 -08:00
Joe Groff
64a2748280
Merge branch 'master' of git://factorcode.org/git/factor
2010-02-17 12:50:46 -08:00
Slava Pestov
33bbd05507
io.pathnames: fix doc typo
2010-02-18 08:38:45 +13:00
Joe Groff
6ac33f6dea
make io.pathnames tests path-separator-neutral
2010-02-16 19:28:51 -08:00
Joe Groff
f59f28d788
io.pathnames: make absolute-path? public
2010-02-16 19:01:44 -08:00
Joe Groff
4a182cfbad
fix append-path and vocab-dir to use path-separator
2010-02-16 18:40:40 -08:00
Brad Christensen
7381d47103
More documentation cleanup.
2010-02-03 00:05:04 -07:00
Doug Coleman
8c1d202b4c
Rename accumulator to collector, pusher to selector
2010-01-22 15:00:53 -06:00
Slava Pestov
dd0571e69a
io.buffers: fix buffer-until for iota (reported by Sascha Matzke)
2010-01-16 18:44:24 +13:00
Slava Pestov
df4fb4a3ee
Removing integers-as-sequences
2010-01-15 07:15:33 +13:00
Slava Pestov
1c10196c43
Rename kernel.private:getenv/setenv to special-object/set-special-object to mirror recent renaming on the VM side
2010-01-13 18:08:18 +13:00
Slava Pestov
eb0a28aa54
Merge branch 'master' of git://factorcode.org/git/factor
2009-12-15 07:21:17 -05:00
Slava Pestov
f6c0c64518
threads, io.streams.c: cleanups
2009-12-15 07:20:41 -05:00
Doug Coleman
9fea67f3ff
triyng to rice crc32 a bit
2009-12-13 02:03:06 -06:00
Slava Pestov
0612bc6177
Factor source files should not be executable
2009-11-21 17:50:43 -06:00
Doug Coleman
cc194416f9
Merge branch 'master' into startup
...
Conflicts:
core/bootstrap/primitives.factor
vm/run.hpp
2009-11-15 02:52:50 -06:00
Doug Coleman
b71d86a1dc
update more 8bit encoding usages
2009-11-12 18:36:47 -06:00
Doug Coleman
aec676edec
use surround/glue instead of 3append
2009-11-12 03:01:09 -06:00
Slava Pestov
41c17f0429
Fixing test failures
2009-11-11 02:40:24 -06:00
Slava Pestov
5d3c4a5404
io.pathnames: document resource: and vocab:
2009-11-10 18:57:46 -06:00
Doug Coleman
e376a0ece2
(normalize-path) -> absolute-path, canonicalize-path -> resolve-symlinks
2009-10-28 17:25:50 -05:00
Doug Coleman
bd13e018dd
memq? -> member-eq?, sorted-memq? -> sorted-member-eq?
2009-10-28 15:02:00 -05:00
Doug Coleman
1476cdb974
reverse-here -> reverse!
2009-10-28 14:40:15 -05:00
Joe Groff
d5d89f03a7
swap around io combinators to avoid a bunch of redundant "input-stream get"s in each-line, each-block, contents, etc.
2009-10-23 00:07:19 -05:00
Doug Coleman
0d4b9132d7
fix a bunch of typos in docs
2009-10-21 17:40:43 -05:00
Doug Coleman
6b6e56a179
change add-init-hook to add-startup-hook, new add-shutdown-hook word
2009-10-19 22:17:02 -04:00
Slava Pestov
4e8a2a2638
io.backend/pathnames: fix help lint
2009-10-17 00:09:57 -05:00
Doug Coleman
6af901a35d
make words public again
2009-10-16 16:59:25 -05:00
Doug Coleman
4cec00f209
improve io.pathnames docs
2009-10-16 05:48:37 -05:00
Doug Coleman
84fd08d86b
update docs for stream-tell
2009-10-03 19:39:06 -05:00
Doug Coleman
1d41f4c66c
add unit test for c stream-tell
2009-10-03 19:07:16 -05:00
Doug Coleman
098fd0248a
support limited-streams correctly for seekable streams
2009-10-03 18:27:09 -05:00
Keith Lazuka
405e5d015b
docs: change $subsection to $subsections
2009-10-02 12:15:48 -04:00
Slava Pestov
adc154e06b
destructors: already-unregistered error had the wrong content, also don't throw an error when disposing a disposable twice
2009-08-24 20:27:22 -05:00
Slava Pestov
46045c882e
Disposables are now registered in a global disposables set. To take advantage of this, subclass disposable instead of providing a disposed slot and call new-disposable instead of new. tools.disposables defines two words, 'disposable.' and 'leaks', to help track down resource lifetime problems
2009-08-24 02:26:13 -05:00
Slava Pestov
030b1b816c
Add inline declarations for various assorted methods
2009-08-17 22:32:21 -05:00
Slava Pestov
bf57d78b09
compiler.tree.modular-arithmetic: >fixnum elimination and value info annotations were too aggressive
2009-08-17 01:20:25 -05:00
Doug Coleman
3f3d57032b
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places, minor refactoring
2009-08-13 19:21:44 -05:00
Doug Coleman
14ef1649d4
add if-zero/when-zero/unless-zero to core/ and update usages
2009-08-11 17:59:40 -05:00
Brad Christensen
f8405e9c55
A number of documentation fixes.
...
* Short-circuit combinators now show correct stack effect for quots
* Groups and Clumps unchecked examples corrected, made runnable in listener
* Class operations had duplicate link to class-types
* Protocol slots readability fixed
* Tuple word property for "tuple-layout" corrected to "layout"
* cond>quot sentence started in lowercase
* Method precedence code example missing stack effect for GENERIC:, M: integer explain changed to detail an integer
* Motivation for default streams readability
* Default input and output streams duplicate readln link removed from output stream words section
* Looping combinators do description clarified
* Make philosophy missing space
* Linear order protocol duplicate after? link removed
* Parsing words readability fix
* Copied note regarding with-compilation-unit from define to define-declared and define-inline
2009-08-10 23:34:25 -07:00
Doug Coleman
eb61ffc56d
use itoa in more places
2009-08-02 18:18:31 -05:00
Joe Groff
dd3c90bf11
add file-stem word to io.pathnames as the counterpart to file-extension. write docs for both
2009-07-30 20:58:32 -05:00
Doug Coleman
78bbf96a6d
move signed-le> to io.binary, clean up using list for math.bitwise
2009-07-23 15:54:57 -05:00
Slava Pestov
ef73bc6732
io.encodings.utf16: cleanup
2009-05-28 02:50:57 -05:00
Slava Pestov
b31fe9b8f2
Implement stricter vocab search path semantics, with a new API for vocabs.parser. Add map-find-last to sequences vocab
2009-05-14 22:31:29 -05:00
Slava Pestov
96b1ae86a4
Clean up init-stdio implementations and move io.streams.null to basis
2009-05-12 03:35:48 -05:00
Slava Pestov
9488e78532
clean up contents and lines words; contents never outputs f now
2009-05-10 16:39:51 -05:00
Doug Coleman
6223198534
link seeking docs to the seek descriptors
2009-05-07 13:01:42 -05:00
Slava Pestov
8e3e67fad4
Fix test failures
2009-05-04 13:10:56 -05:00
Slava Pestov
b4088373b7
Merge branch 'master' of git://factorcode.org/git/factor
2009-05-04 05:16:47 -05:00
Slava Pestov
a63ad6a7a5
Remove cruddy string encoding/decoding code from VM
2009-05-02 13:45:38 -05:00
Doug Coleman
0ad6d1fb7b
add a few usages of iota, remove most 1+ and 1- from core
2009-05-01 19:58:24 -05:00
Doug Coleman
ce7ad9a42d
fix unit tests that call lines or contents
2009-05-01 16:38:04 -05:00
Doug Coleman
28ec9c3a3b
fix spacing in io docs
2009-05-01 15:56:16 -05:00
Doug Coleman
471fe2c272
rename lines to stream-lines
...
rename cnotents to stream-contents
2009-05-01 10:41:27 -05:00
Slava Pestov
a70a2c0e31
Fix some test failures and add an unportable tag
2009-04-30 22:56:15 -05:00
Slava Pestov
c2fe2a4fea
Improve stack checker documentation
2009-04-23 03:48:32 -05:00
Slava Pestov
05f3f9dcb9
Fixing unit tests for stack effect inference changes
2009-04-20 21:15:19 -05:00
Slava Pestov
0d0c7f2d55
Fix unit test failures caused by stricter type checking in M: encoder stream-write
2009-04-20 20:05:17 -05:00
Slava Pestov
0f26d02d41
Passing the wrong type of sequence to M\ encoder write now throws an error
2009-04-20 03:26:56 -05:00
Slava Pestov
fb246e2c85
Documentation fixes
2009-04-06 04:15:58 -05:00
Slava Pestov
9907bd9fe2
Add fseek primitive so that c-streams can seek. This lets the UI work without native IO
2009-04-03 10:16:25 -05:00
Slava Pestov
f97389503f
Fix stream-read-until on byte-readers
2009-03-27 19:26:16 -05:00
Slava Pestov
723bfab030
Fixing unit tests for syntax change
2009-03-23 00:34:02 -05:00
Daniel Ehrenberg
db876598ed
Fixing code-point-length
2009-03-19 17:42:38 -05:00
Doug Coleman
92d58b1160
Add more unit tests for code-point-length
2009-03-19 17:36:49 -05:00
Slava Pestov
786475102d
Make more code infer
2009-03-17 02:19:50 -05:00
Slava Pestov
47dc534901
Help lint fixes
2009-03-15 23:25:29 -05:00
Slava Pestov
07a5a46009
Add stream-element-type generic word
2009-03-15 17:11:18 -05:00
Slava Pestov
7b9491066c
Fix conflict in images vocab
2009-03-04 21:43:56 -06:00
U-SLAVA-DFB8FF805\Slava
83e8cdae1c
io.encodings.utf8 fixed for bootstrap; add unit tests
2009-03-04 21:33:34 -06:00
Slava Pestov
abdf153374
Add utf8-index> and >utf8-index words for dealing with broken C APIs
2009-03-04 20:43:04 -06:00
Daniel Ehrenberg
5aba91a0c5
Merge branch 'master' of git://factorcode.org/git/factor
2009-03-02 00:06:45 -06:00
Daniel Ehrenberg
5b2c0c9cbf
Adding missing inline declarations
2009-03-02 00:06:27 -06:00
Slava Pestov
25a877e50b
Merge OneEyed's patch
2009-02-28 17:06:55 -06:00
Slava Pestov
cd53c2bd37
produce and produce-as: don't need third quotation either
2009-02-28 15:31:34 -06:00
Slava Pestov
78ce670101
Merge branch 'for-slava' of git://git.rfc1149.net/factor
2009-02-28 14:42:56 -06:00
Daniel Ehrenberg
2c462745f1
Redoing string streams and byte-array streams without copying
2009-02-27 00:53:05 -06:00
Slava Pestov
ce1bc1d6ed
Fixing conflicts from stack checker changes
2009-02-24 01:21:10 -06:00
Slava Pestov
91d0c4ed1f
Fix conflict
2009-02-22 20:02:13 -06:00
Doug Coleman
a6b40707df
use CONSTANT: in core/
2009-02-22 19:09:49 -06:00
Slava Pestov
5e19766330
Fix conflict
2009-02-18 22:20:05 -06:00
Doug Coleman
2af9d5a6df
add canonicalize-path, fix a bug in file-extension
2009-02-18 13:33:55 -06:00
Samuel Tardieu
087d931c36
Remove the tail argument from do/until/while
2009-02-18 02:41:14 +01:00
Slava Pestov
73dfa2ae65
Fix conflict
2009-02-16 21:47:35 -06:00
Doug Coleman
53224ebce0
remove empty file
2009-02-16 21:29:13 -06:00
Slava Pestov
421ee726b8
Merge branch 'master' into new_ui
2009-02-16 21:22:12 -06:00
Slava Pestov
6b25e99470
Add summary for heaps more vocabs
2009-02-16 21:05:13 -06:00
Slava Pestov
4a639033fa
Merge branch 'master' into new_ui
2009-02-15 21:06:55 -06:00
Slava Pestov
ebd0e9250f
Clean up some <file-reader> usages to use file-lines, file>csv, and file>xml instead
2009-02-15 20:45:06 -06:00
Slava Pestov
6b99b04531
Add vocab: for vocab-relative paths
2009-02-15 19:53:21 -06:00
Slava Pestov
f14d6b79c6
io.pathnames: Clarify normalize-path docs
2009-02-10 17:30:19 -06:00
Slava Pestov
ab386d01aa
Merge branch 'master' into new_ui
2009-02-10 16:23:14 -06:00
Slava Pestov
07caee3405
Update some existing code to use initialize
2009-02-10 16:16:12 -06:00
Slava Pestov
3045777f02
Fix conflict
2009-02-09 00:34:00 -06:00
Doug Coleman
b529df9652
handle seeking before the file start on windows, add a unit test for this
2009-02-08 20:18:30 -06:00
Slava Pestov
112c94cda2
Merge branch 'master' into new_ui
2009-02-08 18:36:47 -06:00
Doug Coleman
c069add10b
fix using lists
2009-02-08 17:34:17 -06:00