removed <filebr>, <filebw>, renamed <filecr> to <file-reader>, <filecw> to <file-writer>
parent
d29cd15f74
commit
12eceb5b44
|
@ -47,13 +47,11 @@
|
|||
- nicer way to combine two paths
|
||||
- add a socket timeout
|
||||
- rename f* words to stream-*
|
||||
- <file[bc][rw]> is badly named -- <file-reader>, <file-writer>
|
||||
|
||||
+ kernel:
|
||||
|
||||
- ppc register decls
|
||||
- cat, reverse-cat primitives
|
||||
- first-class hashtables
|
||||
|
||||
+ misc:
|
||||
|
||||
|
@ -63,6 +61,7 @@
|
|||
- browser responder for word links in HTTPd
|
||||
- worddef props
|
||||
- prettyprint: when unparse called due to recursion, write a link
|
||||
- vectors: ensure its ok with bignum indices
|
||||
|
||||
+ httpd:
|
||||
|
||||
|
|
|
@ -352,16 +352,15 @@ M: hashtable ' ( hashtable -- pointer )
|
|||
] ifte ;
|
||||
|
||||
: write-image ( image file -- )
|
||||
<filebw> [ [ write-word ] vector-each ] with-stream ;
|
||||
<file-writer> [ [ write-word ] vector-each ] with-stream ;
|
||||
|
||||
: with-minimal-image ( quot -- image )
|
||||
[
|
||||
300000 <vector> image set
|
||||
521 <hashtable> "objects" set
|
||||
<namespace> "objects" set
|
||||
! Note that this is a vector that we can side-effect,
|
||||
! since ; ends up using this variable from nested
|
||||
! parser namespaces.
|
||||
1000 <vector> "word-fixups" set
|
||||
call
|
||||
image get
|
||||
] with-scope ;
|
||||
|
|
|
@ -106,7 +106,7 @@ IN: hashtables
|
|||
|
||||
: grow-hash ( hash -- )
|
||||
#! A good way to earn a living.
|
||||
dup hash-size 3 * 2 /i <array> swap set-hash-array ;
|
||||
dup hash-size 2 * <array> swap set-hash-array ;
|
||||
|
||||
: (hash>alist) ( alist n hash -- alist )
|
||||
2dup bucket-count >= [
|
||||
|
|
|
@ -54,7 +54,7 @@ USE: unparser
|
|||
over file-length file-response "method" get "head" = [
|
||||
drop
|
||||
] [
|
||||
<filebr> stdio get fcopy
|
||||
<file-reader> stdio get fcopy
|
||||
] ifte ;
|
||||
|
||||
: serve-file ( filename -- )
|
||||
|
|
|
@ -41,7 +41,7 @@ USE: url-encoding
|
|||
: httpd-log-stream ( -- stream )
|
||||
#! Set httpd-log-file to save httpd log to a file.
|
||||
"httpd-log-file" get dup [
|
||||
<filecr>
|
||||
<file-reader>
|
||||
] [
|
||||
drop stdio get
|
||||
] ifte ;
|
||||
|
|
|
@ -51,4 +51,4 @@ USE: unparser
|
|||
[ stdio get "log" set call ] with-scope ;
|
||||
|
||||
: with-log-file ( file quot -- )
|
||||
[ swap <filecr> "log" set call ] with-scope ;
|
||||
[ swap <file-reader> "log" set call ] with-scope ;
|
||||
|
|
|
@ -64,18 +64,12 @@ M: fd-stream fclose ( -- )
|
|||
C: fd-stream ( in out -- stream )
|
||||
[ "out" set "in" set ] extend ;
|
||||
|
||||
: <filecr> ( path -- stream )
|
||||
: <file-reader> ( path -- stream )
|
||||
t f open-file <fd-stream> ;
|
||||
|
||||
: <filecw> ( path -- stream )
|
||||
: <file-writer> ( path -- stream )
|
||||
f t open-file <fd-stream> ;
|
||||
|
||||
: <filebr> ( path -- stream )
|
||||
<filecr> ;
|
||||
|
||||
: <filebw> ( path -- stream )
|
||||
<filecw> ;
|
||||
|
||||
: init-stdio ( -- )
|
||||
stdin stdout <fd-stream> <stdio-stream> stdio set ;
|
||||
|
||||
|
@ -94,4 +88,4 @@ C: fd-stream ( in out -- stream )
|
|||
"resource-path" get [ "." ] unless* ;
|
||||
|
||||
: <resource-stream> ( path -- stream )
|
||||
resource-path swap cat2 <filecr> ;
|
||||
resource-path swap cat2 <file-reader> ;
|
||||
|
|
|
@ -75,7 +75,7 @@ USE: strings
|
|||
[ file-vocabs (parse-stream) ] with-scope ;
|
||||
|
||||
: parse-file ( file -- quot )
|
||||
dup <filecr> parse-stream ;
|
||||
dup <file-reader> parse-stream ;
|
||||
|
||||
: run-file ( file -- )
|
||||
#! Run a file. The file is read with the default IN:/USE:
|
||||
|
@ -83,7 +83,7 @@ USE: strings
|
|||
parse-file call ;
|
||||
|
||||
: (parse-file) ( file -- quot )
|
||||
dup <filecr> (parse-stream) ;
|
||||
dup <file-reader> (parse-stream) ;
|
||||
|
||||
: (run-file) ( file -- )
|
||||
#! Run a file. The file is read with the same IN:/USE: as
|
||||
|
|
|
@ -41,7 +41,7 @@ USE: words
|
|||
[ "~" get "/.jedit/server" cat2 ] unless* ;
|
||||
|
||||
: jedit-server-info ( -- port auth )
|
||||
jedit-server-file <filecr> [
|
||||
jedit-server-file <file-reader> [
|
||||
read drop
|
||||
read parse-number
|
||||
read parse-number
|
||||
|
|
Loading…
Reference in New Issue