some unix i/o work

cvs
Slava Pestov 2005-04-06 02:18:36 +00:00
parent b1945f04ae
commit cc5246686f
7 changed files with 36 additions and 15 deletions

View File

@ -22,7 +22,7 @@
- fix up the min thumb size hack
- frame gap
+ fii:
+ ffi:
- replace alien-address, local-alien? primitives with colon defs
- auto-generate box/unbox, and alien accessors
@ -38,6 +38,7 @@
+ compiler/ffi:
- linux? bsd?
- [ [ dup call ] dup call ] infer hangs
- more accurate types for various words
- declarations
@ -53,6 +54,7 @@
+ kernel:
- code walker & exceptions
- string sub-primitives
- clean up metaclasses
- unify unparse and prettyprint
@ -69,3 +71,21 @@
- vector-map, string-map, seq-each, vector-project: consing
- map, subset, project, append: not tail recursive
+ nice to have libraries:
- regexps
- XML
- matrices, vector math
- HTTP client
- real Unicode support (strings are already 16 bits and can be extended
to 21 if the need arises, but we need full character classification
predicates, comparison, case conversion, sorting...)
- full Win32 binding
- Cairo binding
+ httpd:
- virtual hosts
- keep alive

View File

@ -64,7 +64,7 @@ M: compound (compile) ( word -- )
drop
] ifte ;
M: compound (undefine)
M: compound (uncrossref)
dup f "infer-effect" set-word-prop
dup f "no-effect" set-word-prop
decompile ;

View File

@ -85,8 +85,9 @@ C: buffer ( size -- buffer )
: buffer-end ( buffer -- int ) dup buffer-ptr swap buffer-fill + ;
: buffer-peek ( buffer -- char )
buffer@ <alien> 0 alien-unsigned-1 ;
: buffer-pop ( buffer -- char )
[ buffer@ <alien> 0 alien-unsigned-1 1 ] keep
buffer-consume ;
: buffer-set ( string buffer -- )
2dup buffer-ptr string>memory

View File

@ -28,4 +28,4 @@ USE: stdio
! [ [ "\"\" { } vector-nth" ] parse ] [ type-check-error ] catch
! This should not raise an error
[ ] [ f throw ] unit-test
[ 1 2 3 ] [ 1 2 3 f throw ] unit-test

View File

@ -17,11 +17,10 @@ C: reader ( buffer -- reader )
dup buffer-length 0 = [
2drop f
] [
dup buffer-peek dup CHAR: \n = [
dup buffer-pop dup CHAR: \n = [
3drop t
] [
1 pick buffer-consume pick sbuf-append
read-line-loop
pick sbuf-append read-line-loop
] ifte
] ifte ;
@ -85,7 +84,7 @@ GENERIC: refill* ( reader -- )
] ifte ;
: pop-line ( reader -- str )
dup reader-line sbuf>string >r
dup reader-line dup [ sbuf>string ] when >r
f over set-reader-line
f swap set-reader-ready? r> ;

View File

@ -86,17 +86,17 @@ global [ <namespace> crossref set ] bind
#! the crossref hash.
crossref get closure ;
GENERIC: (undefine) ( word -- )
M: word (undefine) drop ;
GENERIC: (uncrossref) ( word -- )
M: word (uncrossref) drop ;
: undefine ( word -- )
dup (undefine) usages [ (undefine) ] each ;
: uncrossref ( word -- )
dup (uncrossref) usages [ (uncrossref) ] each ;
! The word primitive combined with the word def specify what the
! word does when invoked.
: define ( word primitive parameter -- )
pick undefine
pick uncrossref
pick set-word-def
over set-word-primitive
f "parsing" set-word-prop ;

View File

@ -54,7 +54,8 @@ void throw_error(CELL error, bool keep_stacks)
void primitive_throw(void)
{
CELL error = dpop();
throw_error(error,true);
if(error != F)
throw_error(error,true);
}
void primitive_die(void)