Merge branch 'master' of /Users/dharmatech/builds/factor/
commit
c6364fe2b3
|
@ -54,6 +54,7 @@ TUPLE: no-parent-directory path ;
|
||||||
TUPLE: file-info type size permissions modified ;
|
TUPLE: file-info type size permissions modified ;
|
||||||
|
|
||||||
HOOK: file-info io-backend ( path -- info )
|
HOOK: file-info io-backend ( path -- info )
|
||||||
|
HOOK: link-info io-backend ( path -- info )
|
||||||
|
|
||||||
SYMBOL: +regular-file+
|
SYMBOL: +regular-file+
|
||||||
SYMBOL: +directory+
|
SYMBOL: +directory+
|
||||||
|
|
|
@ -89,3 +89,12 @@ M: unix-io file-info ( path -- info )
|
||||||
[ stat-st_mtim timespec-sec seconds unix-1970 time+ ]
|
[ stat-st_mtim timespec-sec seconds unix-1970 time+ ]
|
||||||
} cleave
|
} cleave
|
||||||
\ file-info construct-boa ;
|
\ file-info construct-boa ;
|
||||||
|
|
||||||
|
M: unix-io link-info ( path -- info )
|
||||||
|
lstat* {
|
||||||
|
[ stat>type ]
|
||||||
|
[ stat-st_size ]
|
||||||
|
[ stat-st_mode ]
|
||||||
|
[ stat-st_mtim timespec-sec seconds unix-1970 time+ ]
|
||||||
|
} cleave
|
||||||
|
\ file-info construct-boa ;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! USING: kernel quotations namespaces sequences assocs.lib ;
|
! USING: kernel quotations namespaces sequences assocs.lib ;
|
||||||
|
|
||||||
USING: kernel namespaces namespaces.private quotations sequences
|
USING: kernel namespaces namespaces.private quotations sequences
|
||||||
assocs.lib ;
|
assocs.lib math.parser math sequences.lib ;
|
||||||
|
|
||||||
IN: namespaces.lib
|
IN: namespaces.lib
|
||||||
|
|
||||||
|
@ -17,3 +17,30 @@ IN: namespaces.lib
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: set* ( val var -- ) namestack* set-assoc-stack ;
|
: set* ( val var -- ) namestack* set-assoc-stack ;
|
||||||
|
|
||||||
|
SYMBOL: building-seq
|
||||||
|
: get-building-seq ( n -- seq )
|
||||||
|
building-seq get nth ;
|
||||||
|
|
||||||
|
: n, get-building-seq push ;
|
||||||
|
: n% get-building-seq push-all ;
|
||||||
|
: n# >r number>string r> n% ;
|
||||||
|
|
||||||
|
: 0, 0 n, ;
|
||||||
|
: 0% 0 n% ;
|
||||||
|
: 0# 0 n# ;
|
||||||
|
: 1, 1 n, ;
|
||||||
|
: 1% 1 n% ;
|
||||||
|
: 1# 1 n# ;
|
||||||
|
: 2, 2 n, ;
|
||||||
|
: 2% 2 n% ;
|
||||||
|
: 2# 2 n# ;
|
||||||
|
|
||||||
|
: nmake ( quot exemplars -- seqs )
|
||||||
|
dup length dup zero? [ 1+ ] when
|
||||||
|
[
|
||||||
|
[
|
||||||
|
[ drop 1024 swap new-resizable ] 2map
|
||||||
|
[ building-seq set call ] keep
|
||||||
|
] 2keep >r [ like ] 2map r> firstn
|
||||||
|
] with-scope ;
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
! Copyright (C) 2007 Doug Coleman.
|
! Copyright (C) 2007 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel parser quotations tuples words ;
|
USING: kernel parser quotations prettyprint tuples words ;
|
||||||
IN: singleton
|
IN: singleton
|
||||||
|
|
||||||
: SINGLETON:
|
: SINGLETON:
|
||||||
CREATE-CLASS
|
CREATE-CLASS
|
||||||
dup { } define-tuple-class
|
dup { } define-tuple-class
|
||||||
|
dup unparse create-in reset-generic
|
||||||
dup construct-empty 1quotation define ; parsing
|
dup construct-empty 1quotation define ; parsing
|
||||||
|
|
|
@ -74,3 +74,8 @@ FUNCTION: int mkdir ( char* path, mode_t mode ) ;
|
||||||
"stat" <c-object> dup >r
|
"stat" <c-object> dup >r
|
||||||
stat check-status
|
stat check-status
|
||||||
r> ;
|
r> ;
|
||||||
|
|
||||||
|
: lstat* ( pathname -- stat )
|
||||||
|
"stat" <c-object> dup >r
|
||||||
|
lstat check-status
|
||||||
|
r> ;
|
||||||
|
|
Loading…
Reference in New Issue