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:
Jan Nieuwenhuizen 2018-12-20 16:48:45 +01:00
parent f6e4a00b2a
commit 77ea72bb7d
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
4 changed files with 4 additions and 87 deletions

View File

@ -2604,12 +2604,6 @@ main (int argc, char *argv[])
write_error_ (r1);
eputs ("\n");
}
// if (g_debug > 3)
// {
// eputs ("symbols: ");
// write_error_ (g_symbols);
// eputs ("\n");
// }
r3 = cell_vm_begin_expand;
r1 = eval_apply ();
if (g_debug)

View File

@ -60,10 +60,6 @@ make_initial_module (SCM a) ///((internal))
m0 = module;
while (TYPE (a) == TPAIR)
{
if (g_debug > 3)
{
eputs ("entry="); write_error_ (CAR (a)); eputs ("\n");
}
module_define_x (module, CAAR (a), CDAR (a));
a = CDR (a);
}
@ -102,10 +98,6 @@ module_variable (SCM module, SCM name)
SCM
module_ref (SCM module, SCM name)
{
if (g_debug > 3)
{
eputs ("module_ref: "); display_error_ (name); eputs ("\n");
}
SCM x = module_variable (module, name);
if (x == cell_f)
return cell_undefined;
@ -115,10 +107,6 @@ module_ref (SCM module, SCM name)
SCM
module_define_x (SCM module, SCM name, SCM value)
{
if (g_debug > 4)
{
eputs ("module_define_x: "); display_error_ (name); eputs ("\n");
}
module = m0;
SCM globals = struct_ref_ (module, 5);
return hashq_set_x (globals, name, value);

View File

@ -178,10 +178,6 @@ current_input_port ()
if (g_stdin >= 0)
return MAKE_NUMBER (g_stdin);
SCM x = g_ports;
if (g_debug > 2)
{
eputs ("ports:"); write_error_ (g_ports); eputs ("\n");
}
while (x && PORT (CAR (x)) != g_stdin)
x = CDR (x);
return CAR (x);
@ -197,10 +193,6 @@ SCM
open_input_string (SCM 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);
return port;
}

View File

@ -71,14 +71,6 @@ make_bytes (char const* s, size_t length)
*(char*)p = 0;
else
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;
}
@ -106,69 +98,31 @@ string_equal_p (SCM a, SCM b) ///((name . "string=?"))
assert ((TYPE (a) == TSTRING && TYPE (b) == TSTRING)
|| (TYPE (a) == TKEYWORD || TYPE (b) == TKEYWORD));
}
if (g_debug == -1)
{
eputs ("string=?: "); eputs (CSTRING (a));
eputs (" =? "); eputs (CSTRING (b));
}
if (a == b
|| STRING (a) == STRING (b)
|| (!LENGTH (a) && !LENGTH (b))
|| (LENGTH (a) == LENGTH (b)
&& !memcmp (CSTRING (a), CSTRING (b), LENGTH (a))))
{
if (g_debug == -1)
eputs (" => #t\n");
return cell_t;
}
if (g_debug == -1)
eputs (" => #f\n");
return cell_t;
return cell_f;
}
SCM
symbol_to_string (SCM symbol)
{
SCM x = 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;
return make_cell__ (TSTRING, CAR (symbol), CDR (symbol));
}
SCM
symbol_to_keyword (SCM symbol)
{
SCM x = 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;
return make_cell__ (TKEYWORD, CAR (symbol), CDR (symbol));
}
SCM
keyword_to_string (SCM keyword)
{
SCM x = 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;
return make_cell__ (TSTRING, CAR (keyword), CDR (keyword));
}
SCM
@ -185,17 +139,6 @@ make_symbol (SCM string)
{
SCM x = make_cell__ (TSYMBOL, LENGTH (string), STRING (string));
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;
}