Minor core features
parent
7c1dc2336a
commit
dcdee4ec6f
|
@ -240,13 +240,13 @@ PREDICATE: unexpected unexpected-eof
|
|||
|
||||
: CREATE ( -- word ) scan create-in ;
|
||||
|
||||
: create-class ( word vocab -- word )
|
||||
create
|
||||
: create-class-in ( word vocab -- word )
|
||||
in get create
|
||||
dup save-class-location
|
||||
dup predicate-word dup set-word save-location ;
|
||||
|
||||
: CREATE-CLASS ( -- word )
|
||||
scan in get create-class ;
|
||||
scan create-class-in ;
|
||||
|
||||
: word-restarts ( possibilities -- restarts )
|
||||
natural-sort [
|
||||
|
|
|
@ -441,6 +441,9 @@ PRIVATE>
|
|||
: memq? ( obj seq -- ? )
|
||||
[ eq? ] with contains? ;
|
||||
|
||||
: seq-intersect ( seq1 seq2 -- seq1/\seq2 )
|
||||
swap [ member? ] curry subset ;
|
||||
|
||||
: remove ( obj seq -- newseq )
|
||||
[ = not ] with subset ;
|
||||
|
||||
|
|
|
@ -69,12 +69,12 @@ INSTANCE: groups sequence
|
|||
: split ( seq separators -- pieces ) [ split, ] { } make ;
|
||||
|
||||
: string-lines ( str -- seq )
|
||||
dup [ "\r\n" member? ] contains? [
|
||||
dup "\r\n" seq-intersect empty? [
|
||||
1array
|
||||
] [
|
||||
"\n" split [
|
||||
1 head-slice* [
|
||||
"\r" ?tail drop "\r" split
|
||||
] map
|
||||
] keep peek "\r" split add concat
|
||||
] [
|
||||
1array
|
||||
] if ;
|
||||
|
|
Loading…
Reference in New Issue