]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: nuke unused (string>float) primitive
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 7 Feb 2010 19:16:56 +0000 (08:16 +1300)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 7 Feb 2010 19:16:56 +0000 (08:16 +1300)
basis/stack-checker/known-words/known-words.factor
core/bootstrap/primitives.factor
vm/math.cpp
vm/primitives.cpp
vm/primitives.hpp
vm/vm.hpp

index 4aecd1376e511f7ad134dfad59ee9f6c3dc7b3b6..4bf7dfe0fd98570a2946b7c2117df2d8c8858aac 100644 (file)
@@ -327,9 +327,6 @@ M: bad-executable summary
 \ bignum>float { bignum } { float } define-primitive
 \ bignum>float make-foldable
 
-\ (string>float) { byte-array } { float } define-primitive
-\ (string>float) make-foldable
-
 \ (float>string) { float } { byte-array } define-primitive
 \ (float>string) make-foldable
 
index 57035860d80d52229a4849b9ac38f6ccfa54817e..367dc4d942331aaaf26604b53c61b7f0a6018f0c 100644 (file)
@@ -463,7 +463,6 @@ tuple
     { "double>bits" "math" "primitive_double_bits" (( x -- n )) }
     { "float>bits" "math" "primitive_float_bits" (( x -- n )) }
     { "(float>string)" "math.parser.private" "primitive_float_to_str" (( n -- str )) }
-    { "(string>float)" "math.parser.private" "primitive_str_to_float" (( str -- n/f )) }
     { "bignum*" "math.private" "primitive_bignum_multiply" (( x y -- z )) }
     { "bignum+" "math.private" "primitive_bignum_add" (( x y -- z )) }
     { "bignum-" "math.private" "primitive_bignum_subtract" (( x y -- z )) }
index 2ff6f28d2a17979a881f2cb63ae5228c78398a2a..bb5d9c13c499b026214872e8e75552629b138789 100755 (executable)
@@ -260,20 +260,6 @@ void factor_vm::primitive_bignum_to_float()
        ctx->replace(allot_float(bignum_to_float(ctx->peek())));
 }
 
-void factor_vm::primitive_str_to_float()
-{
-       byte_array *bytes = untag_check<byte_array>(ctx->peek());
-       cell capacity = array_capacity(bytes);
-
-       char *c_str = (char *)(bytes + 1);
-       char *end = c_str;
-       double f = strtod(c_str,&end);
-       if(end == c_str + capacity - 1)
-               ctx->replace(allot_float(f));
-       else
-               ctx->replace(false_object);
-}
-
 void factor_vm::primitive_float_to_str()
 {
        byte_array *array = allot_byte_array(33);
index 1eedab85b8095b8fe0a92d4b2eb7efa2cfdabab8..be9d5c6ff6e2d809731b2fb2ec4943093b22e475 100644 (file)
@@ -121,7 +121,6 @@ PRIMITIVE(set_string_nth_slow)
 PRIMITIVE(size)
 PRIMITIVE(sleep)
 PRIMITIVE(special_object)
-PRIMITIVE(str_to_float)
 PRIMITIVE(string)
 PRIMITIVE(string_nth)
 PRIMITIVE(strip_stack_traces)
index 049b44d389b9b683f4e0adbd87e991d76ae53243..520df423a14833de4085e1ec079c012328e9d7e2 100644 (file)
@@ -117,7 +117,6 @@ DECLARE_PRIMITIVE(set_string_nth_slow)
 DECLARE_PRIMITIVE(size)
 DECLARE_PRIMITIVE(sleep)
 DECLARE_PRIMITIVE(special_object)
-DECLARE_PRIMITIVE(str_to_float)
 DECLARE_PRIMITIVE(string)
 DECLARE_PRIMITIVE(string_nth)
 DECLARE_PRIMITIVE(strip_stack_traces)
index 20a837a58a90efce91901b569f8ab21c43f834fe..714794aa32606a530262ff689ce96339fda8be1b 100755 (executable)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -441,7 +441,6 @@ struct factor_vm
        cell unbox_array_size_slow();
        void primitive_fixnum_to_float();
        void primitive_bignum_to_float();
-       void primitive_str_to_float();
        void primitive_float_to_str();
        void primitive_float_eq();
        void primitive_float_add();