*** empty log message ***
authorMarius Vollmer <mvo@zagadka.de>
Mon, 4 Oct 2004 18:07:12 +0000 (18:07 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Mon, 4 Oct 2004 18:07:12 +0000 (18:07 +0000)
NEWS
ice-9/ChangeLog
libguile/ChangeLog

diff --git a/NEWS b/NEWS
index 4307187..b5ad435 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -211,6 +211,37 @@ but it can also access variables that have not been exported.  It is
 intended only for kluges and temporary fixes and for debugging, not
 for ordinary code.
 
+** Keyword syntax has been made more disciplined.
+
+Previously, the name of a keyword was read as a 'token' but printed as
+a symbol.  Now, it is read as a general Scheme datum which must be a
+symbol.
+
+Previously:
+
+    guile> #:12
+    #:#{12}#
+    guile> #:#{12}#
+    #:#{\#{12}\#}#
+    guile> #:(a b c)
+    #:#{}#
+    ERROR: In expression (a b c):
+           Unbound variable: a
+    guile> #: foo
+    #:#{}#
+    ERROR: Unbound variable: foo
+
+Now:
+
+    guile> #:12
+    ERROR: Wrong type (expecting symbol): 12
+    guile> #:#{12}#
+    #:#{12}#
+    guile> #:(a b c)
+    ERROR: Wrong type (expecting symbol): (a b c)
+    guile> #: foo
+    #:foo
+
 ** 'while' now provides 'break' and 'continue'
 
 break and continue were previously bound in a while loop, but not
@@ -601,6 +632,16 @@ chapter in the reference manual.
 
 There is no replacement for undefine.
 
+* The functions make-keyword-from-dash-symbol and keyword-dash-symbol
+  have been discouraged.
+
+They are relics from a time where a keyword like #:foo was used
+directly as a Tcl option "-foo" and thus keywords were internally
+stored as a symbol with a starting dash.  We now store a symbol
+without the dash.
+
+Use symbol->keyword and keyword->symbol instead.
+
 
 * Changes to the C interface
 
@@ -731,7 +772,7 @@ scm_symbol_to_string and then work with that string.  Because of the
 new string representation, scm_symbol_to_string does not need to copy
 and is thus quite efficient.
 
-** Some string and symbol functions have been discouraged.
+** Some string, symbol and keyword functions have been discouraged.
 
 They don't fit into the uniform naming scheme and are not explicit
 about the character encoding.
@@ -751,6 +792,17 @@ Replace according to the following table:
     SCM_SYMBOL_HASH           -> scm_hashq
     SCM_SYMBOL_INTERNED_P     -> scm_symbol_interned_p
 
+    scm_c_make_keyword        -> scm_from_locale_keyword
+
+** The functions scm_keyword_to_symbol and sym_symbol_to_keyword are
+   now also available to C code.
+
+** SCM_KEYWORDP and SCM_KEYWORDSYM have been deprecated.
+
+Use scm_is_keyword and scm_keyword_to_symbol instead, but note that
+the latter returns the true name of the keyword, not the 'dash name',
+as SCM_KEYWORDSYM used to do.
+
 ** SCM_CELL_WORD_LOC has been deprecated.
 
 Use the new macro SCM_CELL_OBJECT_LOC instead, which returns a pointer
index 52feeb2..89c853f 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-04  Marius Vollmer  <marius.vollmer@uni-dortmund.de>
+
+       * boot-9.scm (symbol->keyword, keyword->symbol): Removed, they are
+       now implemented in C.
+
 2004-09-26  Kevin Ryde  <user42@zip.com.au>
 
        * optargs.scm (let-optional-template, let-keywords-template): Change
index ad3a651..799feea 100644 (file)
@@ -1,3 +1,37 @@
+2004-10-04  Marius Vollmer  <marius.vollmer@uni-dortmund.de>
+
+       * error.c (scm_wrong_type_arg): Do not talk about "argument" for
+       pos == 0.
+
+       Keywords no longer store a 'dash symbol'.  Instead, they store a
+       symbol with their real name.
+       
+       * keywords.h, keywords.c, deprecated.h, deprecated.c
+       (SCM_KEYWORDP, SCM_KEYWORDSYM): Deprecated and implemented in
+       terms of scm_is_keyword and scm_keyword_dash_symbol.
+       
+       * keywords.h, keywords.c, discouraged.h, discouraged.c
+       (scm_make_keyword_from_dash_symbol, scm_keyword_dash_symbol,
+       scm_c_make_keyword): Discouraged.
+
+       * keywords.h, keywords.c (scm_symbol_to_keyword,
+       scm_keyword_to_symbol): Implemented in C.
+       (scm_is_keyword, scm_from_locale_keyword,
+       scm_from_locale_keywordn): New.
+
+       * goops.c: Replaced SCM_KEYWORDP with scm_is_keyword.   
+
+       * snarf.h (SCM_KEYWORD, SCM_GLOBAL_KEYWORD): Use
+       scm_from_locale_keyword instead of scm_c_make_keyword.
+
+       * keywords.c (scm_symbol_to_keyword): Use SCM_ASSERT_TYPE for a
+       better error message.
+
+       * deprecated.c: Include discouraged.h and keywords.h.
+
+       * read.c (scm_lreadr): Simply do (symbol->keyword (read)) after
+       reading '#:' or ':'.  See NEWS for consequences.
+
 2004-09-29  Marius Vollmer  <marius.vollmer@uni-dortmund.de>
 
        * read.c (scm_lreadr): Revert change from 2004-09-22: string