summaryrefslogtreecommitdiff
path: root/libguile
diff options
context:
space:
mode:
authorGary Houston <ghouston@arglist.com>1997-03-10 06:49:15 +0000
committerGary Houston <ghouston@arglist.com>1997-03-10 06:49:15 +0000
commitc773377128287dcd5c6804fc307d84bbf6cd3673 (patch)
tree6cf5b9cf758484bad4160d1dc7c282e430119162 /libguile
parentd2d82421a60ce3c36447ab6307723a2e6656b19c (diff)
downloadguile-c773377128287dcd5c6804fc307d84bbf6cd3673.tar.gz
* read.h (SCM_N_READ_OPTIONS): increase SCM_N_READ_OPTIONS to 4.
(SCM_KEYWORD_STYLE): defined. * read.c (scm_read_opts): add a keywords option. This isn't a boolean option, in case someone wants to add support for DSSSL keywords too. Setup scm_keyword_prefix symbol. (scm_lreadr): Only process keywords if SCM_KEYWORD_STYLE is set to 'prefix. * I've left keyword support disabled by default, since it doesn't seem to break the module system and it gives R4RS standard behaviour. It can be reactivated with (read-set! keywords 'prefix).
Diffstat (limited to 'libguile')
-rw-r--r--libguile/ChangeLog15
-rw-r--r--libguile/read.c21
-rw-r--r--libguile/read.h3
3 files changed, 31 insertions, 8 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index 404f4ad35..cc50d1fcb 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,18 @@
+Mon Mar 10 06:28:54 1997 Gary Houston <ghouston@actrix.gen.nz>
+
+ * read.h (SCM_N_READ_OPTIONS): increase SCM_N_READ_OPTIONS to 4.
+ (SCM_KEYWORD_STYLE): defined.
+
+ * read.c (scm_read_opts): add a keywords option. This isn't a
+ boolean option, in case someone wants to add support for DSSSL
+ keywords too.
+ Setup scm_keyword_prefix symbol.
+ (scm_lreadr): Only process keywords if SCM_KEYWORD_STYLE is
+ set to 'prefix.
+* I've left keyword support disabled by default, since it doesn't
+ seem to break the module system and it gives R4RS standard behaviour.
+ It can be reactivated with (read-set! keywords 'prefix).
+
Sun Mar 9 14:14:39 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
* arbiters.c (scm_make_arbiter): Bugfix: Must SCM_DEFER_INTS
diff --git a/libguile/read.c b/libguile/read.c
index c71cf77fc..a7959f0a7 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -58,13 +58,17 @@
+SCM_SYMBOL (scm_keyword_prefix, "prefix");
+
scm_option scm_read_opts[] = {
{ SCM_OPTION_BOOLEAN, "copy", 0,
"Copy source code expressions." },
{ SCM_OPTION_BOOLEAN, "positions", 0,
"Record positions of source code expressions." },
{ SCM_OPTION_BOOLEAN, "case-insensitive", 0,
- "Convert symbols to lower case."}
+ "Convert symbols to lower case."},
+ { SCM_OPTION_SCM, "keywords", SCM_BOOL_F,
+ "Style of keyword recognition: #f or 'prefix"}
};
SCM_PROC (s_read_options, "read-options-interface", 0, 1, 0, scm_read_options);
@@ -508,12 +512,15 @@ tryagain_no_flush_ws:
goto tok;
case ':':
- j = scm_read_token ('-', tok_buf, port, 0);
- p = scm_intern (SCM_CHARS (*tok_buf), j);
- if (SCM_PORT_REPRESENTATION (port) != scm_regular_port)
- scm_set_symbol_multi_byte_x (SCM_CAR (p), SCM_BOOL_T);
- return scm_make_keyword_from_dash_symbol (SCM_CAR (p));
-
+ if (SCM_KEYWORD_STYLE == scm_keyword_prefix)
+ {
+ j = scm_read_token ('-', tok_buf, port, 0);
+ p = scm_intern (SCM_CHARS (*tok_buf), j);
+ if (SCM_PORT_REPRESENTATION (port) != scm_regular_port)
+ scm_set_symbol_multi_byte_x (SCM_CAR (p), SCM_BOOL_T);
+ return scm_make_keyword_from_dash_symbol (SCM_CAR (p));
+ }
+ /* fallthrough */
default:
j = scm_read_token (c, tok_buf, port, 0);
/* fallthrough */
diff --git a/libguile/read.h b/libguile/read.h
index 74904452b..f30e6660f 100644
--- a/libguile/read.h
+++ b/libguile/read.h
@@ -72,7 +72,8 @@ extern scm_option scm_read_opts[];
#define SCM_COPY_SOURCE_P scm_read_opts[0].val
#define SCM_RECORD_POSITIONS_P scm_read_opts[1].val
#define SCM_CASE_INSENSITIVE_P scm_read_opts[2].val
-#define SCM_N_READ_OPTIONS 3
+#define SCM_KEYWORD_STYLE scm_read_opts[3].val
+#define SCM_N_READ_OPTIONS 4