Skip to content

Commit

Permalink
tools.ps.macosx: use trim-head-slice, simpler.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Apr 26, 2013
1 parent 93d6176 commit 2bc8f3b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions basis/tools/ps/macosx/macosx.factor
Expand Up @@ -122,14 +122,10 @@ STRUCT: kinfo_proc
{ e_login char[12] }
{ e_spare int32_t[4] } ;

: split1-skip-slice ( seq quot: ( elt -- ? ) -- before-slice after-slice )
[ find drop dup ]
[ [ not ] compose find-from drop over or ]
[ drop snip-slice ] 2tri ; inline

: head-split-skip ( seq n quot: ( elt -- ? ) -- pieces )
[ dup 0 >= ] swap '[
[ _ split1-skip-slice ] [ 1 - rot ] bi*
[ _ [ trim-head-slice ] [ split1-when-slice ] bi ]
[ 1 - rot ] bi*
] produce 2nip ; inline

: args ( pid -- args )
Expand Down

0 comments on commit 2bc8f3b

Please sign in to comment.