core: Remove string debugging.
* src/strings.c (make_bytes, make_string, string_equal_p, symbol_to_string, symbol_to_keyword, make_symbol): Remove string debugging.
This commit is contained in:
parent
41db6e22d1
commit
3ebee71653
|
@ -2604,12 +2604,6 @@ main (int argc, char *argv[])
|
||||||
write_error_ (r1);
|
write_error_ (r1);
|
||||||
eputs ("\n");
|
eputs ("\n");
|
||||||
}
|
}
|
||||||
// if (g_debug > 3)
|
|
||||||
// {
|
|
||||||
// eputs ("symbols: ");
|
|
||||||
// write_error_ (g_symbols);
|
|
||||||
// eputs ("\n");
|
|
||||||
// }
|
|
||||||
r3 = cell_vm_begin_expand;
|
r3 = cell_vm_begin_expand;
|
||||||
r1 = eval_apply ();
|
r1 = eval_apply ();
|
||||||
if (g_debug)
|
if (g_debug)
|
||||||
|
|
12
src/module.c
12
src/module.c
|
@ -60,10 +60,6 @@ make_initial_module (SCM a) ///((internal))
|
||||||
m0 = module;
|
m0 = module;
|
||||||
while (TYPE (a) == TPAIR)
|
while (TYPE (a) == TPAIR)
|
||||||
{
|
{
|
||||||
if (g_debug > 3)
|
|
||||||
{
|
|
||||||
eputs ("entry="); write_error_ (CAR (a)); eputs ("\n");
|
|
||||||
}
|
|
||||||
module_define_x (module, CAAR (a), CDAR (a));
|
module_define_x (module, CAAR (a), CDAR (a));
|
||||||
a = CDR (a);
|
a = CDR (a);
|
||||||
}
|
}
|
||||||
|
@ -102,10 +98,6 @@ module_variable (SCM module, SCM name)
|
||||||
SCM
|
SCM
|
||||||
module_ref (SCM module, SCM name)
|
module_ref (SCM module, SCM name)
|
||||||
{
|
{
|
||||||
if (g_debug > 3)
|
|
||||||
{
|
|
||||||
eputs ("module_ref: "); display_error_ (name); eputs ("\n");
|
|
||||||
}
|
|
||||||
SCM x = module_variable (module, name);
|
SCM x = module_variable (module, name);
|
||||||
if (x == cell_f)
|
if (x == cell_f)
|
||||||
return cell_undefined;
|
return cell_undefined;
|
||||||
|
@ -115,10 +107,6 @@ module_ref (SCM module, SCM name)
|
||||||
SCM
|
SCM
|
||||||
module_define_x (SCM module, SCM name, SCM value)
|
module_define_x (SCM module, SCM name, SCM value)
|
||||||
{
|
{
|
||||||
if (g_debug > 4)
|
|
||||||
{
|
|
||||||
eputs ("module_define_x: "); display_error_ (name); eputs ("\n");
|
|
||||||
}
|
|
||||||
module = m0;
|
module = m0;
|
||||||
SCM globals = struct_ref_ (module, 5);
|
SCM globals = struct_ref_ (module, 5);
|
||||||
return hashq_set_x (globals, name, value);
|
return hashq_set_x (globals, name, value);
|
||||||
|
|
|
@ -178,10 +178,6 @@ current_input_port ()
|
||||||
if (g_stdin >= 0)
|
if (g_stdin >= 0)
|
||||||
return MAKE_NUMBER (g_stdin);
|
return MAKE_NUMBER (g_stdin);
|
||||||
SCM x = g_ports;
|
SCM x = g_ports;
|
||||||
if (g_debug > 2)
|
|
||||||
{
|
|
||||||
eputs ("ports:"); write_error_ (g_ports); eputs ("\n");
|
|
||||||
}
|
|
||||||
while (x && PORT (CAR (x)) != g_stdin)
|
while (x && PORT (CAR (x)) != g_stdin)
|
||||||
x = CDR (x);
|
x = CDR (x);
|
||||||
return CAR (x);
|
return CAR (x);
|
||||||
|
@ -197,10 +193,6 @@ SCM
|
||||||
open_input_string (SCM string)
|
open_input_string (SCM string)
|
||||||
{
|
{
|
||||||
SCM port = MAKE_STRING_PORT (string);
|
SCM port = MAKE_STRING_PORT (string);
|
||||||
if (g_debug > 2)
|
|
||||||
{
|
|
||||||
eputs ("new port:"); write_error_ (port); eputs ("\n");
|
|
||||||
}
|
|
||||||
g_ports = cons (port, g_ports);
|
g_ports = cons (port, g_ports);
|
||||||
return port;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,14 +71,6 @@ make_bytes (char const* s, size_t length)
|
||||||
*(char*)p = 0;
|
*(char*)p = 0;
|
||||||
else
|
else
|
||||||
memcpy (p, s, length + 1);
|
memcpy (p, s, length + 1);
|
||||||
if (g_debug > 2)
|
|
||||||
{
|
|
||||||
eputs ("make bytes: "); eputs (s); eputs ("\n");
|
|
||||||
eputs (" bytes: "); eputs (CBYTES (x)); eputs ("\n");
|
|
||||||
eputs (" length: "); eputs (itoa (length)); eputs ("\n");
|
|
||||||
eputs (" ==> "); write_error_ (x);
|
|
||||||
eputs ("\n");
|
|
||||||
}
|
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,69 +98,31 @@ string_equal_p (SCM a, SCM b) ///((name . "string=?"))
|
||||||
assert ((TYPE (a) == TSTRING && TYPE (b) == TSTRING)
|
assert ((TYPE (a) == TSTRING && TYPE (b) == TSTRING)
|
||||||
|| (TYPE (a) == TKEYWORD || TYPE (b) == TKEYWORD));
|
|| (TYPE (a) == TKEYWORD || TYPE (b) == TKEYWORD));
|
||||||
}
|
}
|
||||||
if (g_debug == -1)
|
|
||||||
{
|
|
||||||
eputs ("string=?: "); eputs (CSTRING (a));
|
|
||||||
eputs (" =? "); eputs (CSTRING (b));
|
|
||||||
}
|
|
||||||
if (a == b
|
if (a == b
|
||||||
|| STRING (a) == STRING (b)
|
|| STRING (a) == STRING (b)
|
||||||
|| (!LENGTH (a) && !LENGTH (b))
|
|| (!LENGTH (a) && !LENGTH (b))
|
||||||
|| (LENGTH (a) == LENGTH (b)
|
|| (LENGTH (a) == LENGTH (b)
|
||||||
&& !memcmp (CSTRING (a), CSTRING (b), LENGTH (a))))
|
&& !memcmp (CSTRING (a), CSTRING (b), LENGTH (a))))
|
||||||
{
|
return cell_t;
|
||||||
if (g_debug == -1)
|
|
||||||
eputs (" => #t\n");
|
|
||||||
return cell_t;
|
|
||||||
}
|
|
||||||
if (g_debug == -1)
|
|
||||||
eputs (" => #f\n");
|
|
||||||
return cell_f;
|
return cell_f;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
symbol_to_string (SCM symbol)
|
symbol_to_string (SCM symbol)
|
||||||
{
|
{
|
||||||
SCM x = make_cell__ (TSTRING, CAR (symbol), CDR (symbol));
|
return make_cell__ (TSTRING, CAR (symbol), CDR (symbol));
|
||||||
|
|
||||||
if (g_debug > 2)
|
|
||||||
{
|
|
||||||
eputs ("symbol->string: "); eputs (CSTRING (x)); eputs ("\n");
|
|
||||||
eputs (" was: "); write_error_ (symbol);
|
|
||||||
eputs ("==> "); write_error_ (x);
|
|
||||||
eputs ("\n");
|
|
||||||
}
|
|
||||||
return x;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
symbol_to_keyword (SCM symbol)
|
symbol_to_keyword (SCM symbol)
|
||||||
{
|
{
|
||||||
SCM x = make_cell__ (TKEYWORD, CAR (symbol), CDR (symbol));
|
return make_cell__ (TKEYWORD, CAR (symbol), CDR (symbol));
|
||||||
|
|
||||||
if (g_debug > 2)
|
|
||||||
{
|
|
||||||
eputs ("symbol->keyword: "); eputs (CSTRING (x)); eputs ("\n");
|
|
||||||
eputs (" was: "); write_error_ (symbol);
|
|
||||||
eputs ("==> "); write_error_ (x);
|
|
||||||
eputs ("\n");
|
|
||||||
}
|
|
||||||
return x;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
keyword_to_string (SCM keyword)
|
keyword_to_string (SCM keyword)
|
||||||
{
|
{
|
||||||
SCM x = make_cell__ (TSTRING, CAR (keyword), CDR (keyword));
|
return make_cell__ (TSTRING, CAR (keyword), CDR (keyword));
|
||||||
|
|
||||||
if (g_debug > 2)
|
|
||||||
{
|
|
||||||
eputs ("keyword->string: "); eputs (CSTRING (x)); eputs ("\n");
|
|
||||||
eputs (" was: "); write_error_ (keyword);
|
|
||||||
eputs ("==> "); write_error_ (x);
|
|
||||||
eputs ("\n");
|
|
||||||
}
|
|
||||||
return x;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
|
@ -185,17 +139,6 @@ make_symbol (SCM string)
|
||||||
{
|
{
|
||||||
SCM x = make_cell__ (TSYMBOL, LENGTH (string), STRING (string));
|
SCM x = make_cell__ (TSYMBOL, LENGTH (string), STRING (string));
|
||||||
hash_set_x (g_symbols, string, x);
|
hash_set_x (g_symbols, string, x);
|
||||||
|
|
||||||
if (g_debug > 3)
|
|
||||||
hash_table_printer (g_symbols);
|
|
||||||
|
|
||||||
if (g_debug > 2)
|
|
||||||
{
|
|
||||||
eputs ("make_symbol: "); eputs (CSTRING (string)); eputs ("\n");
|
|
||||||
eputs ("==> "); write_error_ (x);
|
|
||||||
eputs ("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue