Commit 9a79b20c authored by Andreas Schwab's avatar Andreas Schwab
Browse files

Implement ## reader macro

* src/lread.c (read1): Read ## as empty symbol.

* src/print.c (print_object): Print empty symbol as ##.
parent d55e9c53
2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
* print.c (print_object): Print empty symbol as ##.
* lread.c (read1): Read ## as empty symbol.
2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
* nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
......
......@@ -2670,6 +2670,9 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
}
goto read_symbol;
}
/* ## is the empty symbol. */
if (c == '#')
return Fintern (build_string (""), Qnil);
/* Reader forms that can reuse previously read objects. */
if (c >= '0' && c <= '9')
{
......
......@@ -1536,13 +1536,19 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
else
confusing = 0;
size_byte = SBYTES (name);
if (! NILP (Vprint_gensym) && !SYMBOL_INTERNED_P (obj))
{
PRINTCHAR ('#');
PRINTCHAR (':');
}
size_byte = SBYTES (name);
else if (size_byte == 0)
{
PRINTCHAR ('#');
PRINTCHAR ('#');
break;
}
for (i = 0, i_byte = 0; i_byte < size_byte;)
{
......@@ -1555,7 +1561,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
{
if (c == '\"' || c == '\\' || c == '\''
|| c == ';' || c == '#' || c == '(' || c == ')'
|| c == ',' || c =='.' || c == '`'
|| c == ',' || c == '.' || c == '`'
|| c == '[' || c == ']' || c == '?' || c <= 040
|| confusing)
PRINTCHAR ('\\'), confusing = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment