]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/money/money.factor
if-empty changes
[factor.git] / extra / money / money.factor
index bf9f4d3a67952ba0a4089c1b5f72697bf9035b9a..fb743e15af24568ffc4fe9ee1b43175d85e57430 100644 (file)
@@ -22,7 +22,7 @@ ERROR: not-a-decimal x ;
 : parse-decimal ( str -- ratio )
     "." split1
     >r dup "-" head? [ drop t "0" ] [ f swap ] if r>
-    [ dup empty? [ drop "0" ] when ] bi@
+    [ [ "0" ] when-empty ] bi@
     dup length
     >r [ dup string>number [ nip ] [ not-a-decimal ] if* ] bi@ r>
     10 swap ^ / + swap [ neg ] when ;