[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] #183: symbols starting with # do not have read-write
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] #183: symbols starting with # do not have read-write invariance |
Date: |
Fri, 05 Mar 2010 07:49:05 -0000 |
#183: symbols starting with # do not have read-write invariance
----------------------------+-----------------------------------------------
Reporter: zbigniew | Owner:
Type: defect | Status: new
Priority: minor | Milestone: 4.4.0
Component: core libraries | Version: 4.3.x
Keywords: |
----------------------------+-----------------------------------------------
I noticed this because if I have a string "#hostinfo#" and do
string->symbol on it and write it to a file, (read) on this file causes a
syntax error.
I am not sure, but at first glance you might fix this by changing
(not (##core#inline "C_substring_compare" "#!" str 0 0 2))
to
(not (##core#inline "C_substring_compare" "#" str 0 0 1))
or a more efficient equivalent in sym-is-readable? in library.scm. As far
as I know, anything starting with # is sharp-syntax and is unlikely to be
read as a symbol. Yes?
Examples:
{{{
#;> (with-input-from-string (with-output-to-string (lambda () (write
(string->symbol "#x")))) read)
Error: illegal number syntax: ""
#;> (with-input-from-string (with-output-to-string (lambda () (write
(string->symbol "#hostinfo")))) read)
Error: invalid sharp-sign read syntax: #\h
#;> (symbol? (with-input-from-string (with-output-to-string (lambda ()
(write (string->symbol "#t")))) read))
#f
#;> (char? (with-input-from-string (with-output-to-string (lambda ()
(write (string->symbol "#\\x")))) read))
#t
}}}
--
Ticket URL: <http://www.irp.oist.jp/trac/chicken/ticket/183>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #183: symbols starting with # do not have read-write invariance,
Chicken Trac <=
- [Chicken-janitors] Re: #183: symbols starting with # do not have read-write invariance, Chicken Trac, 2010/03/05
- [Chicken-janitors] Re: #183: symbols starting with # do not have read-write invariance, Chicken Trac, 2010/03/05
- [Chicken-janitors] Re: #183: symbols starting with # do not have read-write invariance, Chicken Trac, 2010/03/05
- [Chicken-janitors] Re: #183: symbols starting with # do not have read-write invariance, Chicken Trac, 2010/03/05
- [Chicken-janitors] Re: #183: symbols starting with # do not have read-write invariance, Chicken Trac, 2010/03/05