mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-08 13:37:33 +02:00
Removed string->number2
This commit is contained in:
parent
9e27db1025
commit
b3b29ae15f
7 changed files with 10 additions and 21 deletions
|
@ -339,7 +339,6 @@ extern const object primitive_cddddr;
|
||||||
extern const object primitive_char_91_125integer;
|
extern const object primitive_char_91_125integer;
|
||||||
extern const object primitive_integer_91_125char;
|
extern const object primitive_integer_91_125char;
|
||||||
extern const object primitive_string_91_125number;
|
extern const object primitive_string_91_125number;
|
||||||
extern const object primitive_string_91_125number2;
|
|
||||||
extern const object primitive_string_91cmp;
|
extern const object primitive_string_91cmp;
|
||||||
extern const object primitive_string_91append;
|
extern const object primitive_string_91append;
|
||||||
extern const object primitive_list_91_125string;
|
extern const object primitive_list_91_125string;
|
||||||
|
|
|
@ -2039,8 +2039,6 @@ void _string_91_125number(void *data, object cont, object args) {
|
||||||
Cyc_string2number2_(data, cont, 2, car(args), cadr(args));
|
Cyc_string2number2_(data, cont, 2, car(args), cadr(args));
|
||||||
} else {
|
} else {
|
||||||
Cyc_string2number_(data, cont, car(args)); }}}
|
Cyc_string2number_(data, cont, car(args)); }}}
|
||||||
void _string_91_125number2(void *data, object cont, object args) {
|
|
||||||
_string_91_125number(data, cont, args); }
|
|
||||||
void _string_91length(void *data, object cont, object args) {
|
void _string_91length(void *data, object cont, object args) {
|
||||||
Cyc_check_num_args(data, "string-length", 1, args);
|
Cyc_check_num_args(data, "string-length", 1, args);
|
||||||
{ integer_type i = Cyc_string_length(data, car(args));
|
{ integer_type i = Cyc_string_length(data, car(args));
|
||||||
|
@ -2712,7 +2710,6 @@ static primitive_type cddddr_primitive = {{0}, primitive_tag, "cddddr", &_cddddr
|
||||||
static primitive_type char_91_125integer_primitive = {{0}, primitive_tag, "char->integer", &_char_91_125integer};
|
static primitive_type char_91_125integer_primitive = {{0}, primitive_tag, "char->integer", &_char_91_125integer};
|
||||||
static primitive_type integer_91_125char_primitive = {{0}, primitive_tag, "integer->char", &_integer_91_125char};
|
static primitive_type integer_91_125char_primitive = {{0}, primitive_tag, "integer->char", &_integer_91_125char};
|
||||||
static primitive_type string_91_125number_primitive = {{0}, primitive_tag, "string->number", &_string_91_125number};
|
static primitive_type string_91_125number_primitive = {{0}, primitive_tag, "string->number", &_string_91_125number};
|
||||||
static primitive_type string_91_125number_primitive2 = {{0}, primitive_tag, "string->number2", &_string_91_125number2};
|
|
||||||
static primitive_type string_91length_primitive = {{0}, primitive_tag, "string-length", &_string_91length};
|
static primitive_type string_91length_primitive = {{0}, primitive_tag, "string-length", &_string_91length};
|
||||||
static primitive_type substring_primitive = {{0}, primitive_tag, "substring", &_cyc_substring};
|
static primitive_type substring_primitive = {{0}, primitive_tag, "substring", &_cyc_substring};
|
||||||
static primitive_type string_91ref_primitive = {{0}, primitive_tag, "string-ref", &_cyc_string_91ref};
|
static primitive_type string_91ref_primitive = {{0}, primitive_tag, "string-ref", &_cyc_string_91ref};
|
||||||
|
@ -2834,7 +2831,6 @@ const object primitive_cddddr = &cddddr_primitive;
|
||||||
const object primitive_char_91_125integer = &char_91_125integer_primitive;
|
const object primitive_char_91_125integer = &char_91_125integer_primitive;
|
||||||
const object primitive_integer_91_125char = &integer_91_125char_primitive;
|
const object primitive_integer_91_125char = &integer_91_125char_primitive;
|
||||||
const object primitive_string_91_125number = &string_91_125number_primitive;
|
const object primitive_string_91_125number = &string_91_125number_primitive;
|
||||||
const object primitive_string_91_125number2 = &string_91_125number_primitive2;
|
|
||||||
const object primitive_string_91length = &string_91length_primitive;
|
const object primitive_string_91length = &string_91length_primitive;
|
||||||
const object primitive_substring = &substring_primitive;
|
const object primitive_substring = &substring_primitive;
|
||||||
const object primitive_string_91ref = &string_91ref_primitive;
|
const object primitive_string_91ref = &string_91ref_primitive;
|
||||||
|
|
|
@ -521,7 +521,6 @@
|
||||||
((eq? p 'char->integer) "Cyc_char2integer")
|
((eq? p 'char->integer) "Cyc_char2integer")
|
||||||
((eq? p 'integer->char) "Cyc_integer2char")
|
((eq? p 'integer->char) "Cyc_integer2char")
|
||||||
((eq? p 'string->number)"Cyc_string2number2_")
|
((eq? p 'string->number)"Cyc_string2number2_")
|
||||||
((eq? p 'string->number2)"Cyc_string2number2_")
|
|
||||||
((eq? p 'list->string) "Cyc_list2string")
|
((eq? p 'list->string) "Cyc_list2string")
|
||||||
((eq? p 'make-vector) "Cyc_make_vector")
|
((eq? p 'make-vector) "Cyc_make_vector")
|
||||||
((eq? p 'list->vector) "Cyc_list2vector")
|
((eq? p 'list->vector) "Cyc_list2vector")
|
||||||
|
@ -604,7 +603,6 @@
|
||||||
Cyc-write-char
|
Cyc-write-char
|
||||||
integer->char
|
integer->char
|
||||||
string->number
|
string->number
|
||||||
string->number2
|
|
||||||
list->string
|
list->string
|
||||||
make-vector
|
make-vector
|
||||||
list->vector
|
list->vector
|
||||||
|
@ -652,7 +650,6 @@
|
||||||
((eq? p '*) "common_type")
|
((eq? p '*) "common_type")
|
||||||
((eq? p '/) "common_type")
|
((eq? p '/) "common_type")
|
||||||
((eq? p 'string->number) "object")
|
((eq? p 'string->number) "object")
|
||||||
((eq? p 'string->number2) "object")
|
|
||||||
((eq? p 'string-cmp) "integer_type")
|
((eq? p 'string-cmp) "integer_type")
|
||||||
((eq? p 'string-append) "object")
|
((eq? p 'string-append) "object")
|
||||||
((eq? p 'string-length) "integer_type")
|
((eq? p 'string-length) "integer_type")
|
||||||
|
@ -683,7 +680,6 @@
|
||||||
system
|
system
|
||||||
Cyc-installation-dir
|
Cyc-installation-dir
|
||||||
string->number
|
string->number
|
||||||
string->number2
|
|
||||||
string-append string-cmp list->string
|
string-append string-cmp list->string
|
||||||
make-vector list->vector
|
make-vector list->vector
|
||||||
symbol->string number->string
|
symbol->string number->string
|
||||||
|
@ -699,7 +695,7 @@
|
||||||
(and (prim? exp)
|
(and (prim? exp)
|
||||||
(member exp '(Cyc-read-line apply command-line-arguments number->string
|
(member exp '(Cyc-read-line apply command-line-arguments number->string
|
||||||
read-char peek-char
|
read-char peek-char
|
||||||
symbol->string list->string substring string-append string->number string->number2
|
symbol->string list->string substring string-append string->number
|
||||||
make-vector list->vector Cyc-installation-dir))))
|
make-vector list->vector Cyc-installation-dir))))
|
||||||
|
|
||||||
;; Primitive functions that pass a continuation or thread data but have no other arguments
|
;; Primitive functions that pass a continuation or thread data but have no other arguments
|
||||||
|
@ -711,7 +707,7 @@
|
||||||
(define (prim:arg-count? exp)
|
(define (prim:arg-count? exp)
|
||||||
(and (prim? exp)
|
(and (prim? exp)
|
||||||
(member exp '(error Cyc-write Cyc-display
|
(member exp '(error Cyc-write Cyc-display
|
||||||
string->number2 string->number string-append
|
string->number string-append
|
||||||
+ - * /))))
|
+ - * /))))
|
||||||
|
|
||||||
;; Does primitive allocate an object?
|
;; Does primitive allocate an object?
|
||||||
|
|
|
@ -502,7 +502,6 @@
|
||||||
char->integer
|
char->integer
|
||||||
integer->char
|
integer->char
|
||||||
string->number
|
string->number
|
||||||
string->number2
|
|
||||||
string-append
|
string-append
|
||||||
string-cmp
|
string-cmp
|
||||||
list->string
|
list->string
|
||||||
|
|
|
@ -233,7 +233,6 @@
|
||||||
(list 'char->integer char->integer)
|
(list 'char->integer char->integer)
|
||||||
(list 'integer->char integer->char)
|
(list 'integer->char integer->char)
|
||||||
(list 'string->number string->number)
|
(list 'string->number string->number)
|
||||||
(list 'string->number2 string->number2)
|
|
||||||
(list 'string-cmp string-cmp)
|
(list 'string-cmp string-cmp)
|
||||||
(list 'string-append string-append)
|
(list 'string-append string-append)
|
||||||
(list 'list->string list->string)
|
(list 'list->string list->string)
|
||||||
|
|
|
@ -331,13 +331,13 @@
|
||||||
(parse-atom num)))))
|
(parse-atom num)))))
|
||||||
((eq? #\b next-c)
|
((eq? #\b next-c)
|
||||||
(parse-number fp toks all? parens ptbl
|
(parse-number fp toks all? parens ptbl
|
||||||
2 (lambda (num) (string->number2 (list->string num) 2))))
|
2 (lambda (num) (string->number (list->string num) 2))))
|
||||||
((eq? #\o next-c)
|
((eq? #\o next-c)
|
||||||
(parse-number fp toks all? parens ptbl
|
(parse-number fp toks all? parens ptbl
|
||||||
8 (lambda (num) (string->number2 (list->string num) 8))))
|
8 (lambda (num) (string->number (list->string num) 8))))
|
||||||
((eq? #\x next-c)
|
((eq? #\x next-c)
|
||||||
(parse-number fp toks all? parens ptbl
|
(parse-number fp toks all? parens ptbl
|
||||||
16 (lambda (num) (string->number2 (list->string num) 16))))
|
16 (lambda (num) (string->number (list->string num) 16))))
|
||||||
;; Vector
|
;; Vector
|
||||||
((eq? #\( next-c)
|
((eq? #\( next-c)
|
||||||
(let ((sub (parse fp '() '() #t #f (+ parens 1) ptbl))
|
(let ((sub (parse fp '() '() #t #f (+ parens 1) ptbl))
|
||||||
|
@ -466,7 +466,7 @@
|
||||||
(define (parse-atom a)
|
(define (parse-atom a)
|
||||||
(cond
|
(cond
|
||||||
((token-numeric? a)
|
((token-numeric? a)
|
||||||
(string->number2 (list->string a)))
|
(string->number (list->string a)))
|
||||||
(else
|
(else
|
||||||
(string->symbol (list->string a)))))
|
(string->symbol (list->string a)))))
|
||||||
|
|
||||||
|
|
|
@ -181,10 +181,10 @@
|
||||||
(assert:equal "" (string-append "test") "test")
|
(assert:equal "" (string-append "test") "test")
|
||||||
(assert:equal "" (string-append "ab" "cdefgh ij" "klmno" "p" "q" "rs " "tuv" "w" " x " "yz")
|
(assert:equal "" (string-append "ab" "cdefgh ij" "klmno" "p" "q" "rs " "tuv" "w" " x " "yz")
|
||||||
"abcdefgh ijklmnopqrs tuvw x yz")
|
"abcdefgh ijklmnopqrs tuvw x yz")
|
||||||
(assert:equal "" (string->number2 "0") 0)
|
(assert:equal "" (string->number "0") 0)
|
||||||
(assert:equal "" (string->number2 "42") 42)
|
(assert:equal "" (string->number "42") 42)
|
||||||
;(assert:equal "" (string->number2 "343243243232") ;; Note no bignum support
|
;(assert:equal "" (string->number "343243243232") ;; Note no bignum support
|
||||||
(assert:equal "" (string->number2 "3.14159") 3.14159)
|
(assert:equal "" (string->number "3.14159") 3.14159)
|
||||||
(assert:equal "" (list->string (list #\A #\B #\C)) "ABC")
|
(assert:equal "" (list->string (list #\A #\B #\C)) "ABC")
|
||||||
(assert:equal "" (list->string (list #\A)) "A")
|
(assert:equal "" (list->string (list #\A)) "A")
|
||||||
(assert:equal "" (list->string (list)) "")
|
(assert:equal "" (list->string (list)) "")
|
||||||
|
|
Loading…
Add table
Reference in a new issue