]> gitweb.factorcode.org Git - factor.git/commitdiff
math.extras: adding "until-zero".
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 31 Aug 2012 22:00:53 +0000 (15:00 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 31 Aug 2012 22:00:53 +0000 (15:00 -0700)
extra/math/extras/extras.factor

index 556549e3b94fae22b5ed6caa1571719550f5118b..f3f6cea307fee4ea517a2527cb0568047b303e81 100644 (file)
@@ -148,3 +148,6 @@ PRIVATE>
 
 : sinc ( x -- y )
     [ 1 ] [ pi * [ sin ] [ / ] bi ] if-zero ;
+
+: until-zero ( n quot -- )
+    [ dup zero? ] swap until drop ; inline