Paste: home-path
Author: | tgunr |
Mode: | factor |
Date: | Thu, 8 Dec 2011 20:15:48 |
Plain Text |
: home-path ( path -- newpath )
[ "/" head? ] keep swap
[ home prepend-path ]
[ path-components [ first user-passwd ] keep
over
[
0 swap remove-nth
swap dir>> prefix
components-to-path
] [
components-to-path
] if
] if
;
####
Asset: home-path
The input quotations to âifâ don't match their expected effects
Input Expected Got
[ 0 swap remove-nth swap dir>> prefix components-to-path ] ( ..a -- ..b ) ( x -- x )
[ components-to-path ] ( ..a -- ..b ) ( x -- x x )
:errors - show 1 compiler errors
New Annotation