rename last-slice1 to slice1-last
parent
26cb48b0ab
commit
fb8bdfe7e5
|
@ -26,7 +26,7 @@ IN: cocoa.dialogs
|
|||
[ -> filenames CF>string-array ] [ drop f ] if ;
|
||||
|
||||
: split-path ( path -- dir file )
|
||||
"/" last-split1 [ <NSString> ] bi@ ;
|
||||
"/" split1-last [ <NSString> ] bi@ ;
|
||||
|
||||
: save-panel ( path -- paths )
|
||||
<NSSavePanel> dup
|
||||
|
|
|
@ -36,7 +36,7 @@ TUPLE: line-break ;
|
|||
{ "http://" "https://" "ftp://" } [ head? ] with contains? ;
|
||||
|
||||
: simple-link-title ( string -- string' )
|
||||
dup absolute-url? [ "/" last-split1 swap or ] unless ;
|
||||
dup absolute-url? [ "/" split1-last swap or ] unless ;
|
||||
|
||||
EBNF: parse-farkup
|
||||
nl = ("\r\n" | "\r" | "\n") => [[ drop "\n" ]]
|
||||
|
|
|
@ -153,7 +153,7 @@ ERROR: invalid-header-string string ;
|
|||
|
||||
: extract-email ( recepient -- email )
|
||||
! This could be much smarter.
|
||||
" " last-split1 swap or "<" ?head drop ">" ?tail drop ;
|
||||
" " split1-last swap or "<" ?head drop ">" ?tail drop ;
|
||||
|
||||
: email>headers ( email -- hashtable )
|
||||
[
|
||||
|
|
|
@ -132,7 +132,7 @@ M: url present
|
|||
{ [ dup empty? ] [ drop ] }
|
||||
{ [ over "/" tail? ] [ append ] }
|
||||
{ [ "/" pick start not ] [ nip ] }
|
||||
[ [ "/" last-split1 drop "/" ] dip 3append ]
|
||||
[ [ "/" split1-last drop "/" ] dip 3append ]
|
||||
} cond ;
|
||||
|
||||
PRIVATE>
|
||||
|
|
|
@ -150,7 +150,7 @@ PRIVATE>
|
|||
] unless ;
|
||||
|
||||
: file-extension ( filename -- extension )
|
||||
"." last-split1 nip ;
|
||||
"." split1-last nip ;
|
||||
|
||||
! File info
|
||||
TUPLE: file-info type size permissions created modified
|
||||
|
|
|
@ -44,7 +44,7 @@ DEFER: shallow-fry
|
|||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
: deep-fry ( quot -- quot )
|
||||
{ _ } last-split1 dup
|
||||
{ _ } split1-last dup
|
||||
[
|
||||
shallow-fry [ >r ] rot
|
||||
deep-fry [ [ dip ] curry r> compose ] 4array concat
|
||||
|
|
Loading…
Reference in New Issue