vm: nuke unused (string>float) primitive
parent
4e766a0a12
commit
747974f4ae
|
@ -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
|
||||
|
||||
|
|
|
@ -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 )) }
|
||||
|
|
14
vm/math.cpp
14
vm/math.cpp
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue