From jedediah at jdhuntington.com Thu Mar 20 00:38:23 2008 From: jedediah at jdhuntington.com (JD Huntington) Date: Wed, 19 Mar 2008 21:38:23 -0700 Subject: [Bus-scheme-discuss] Character Literals Message-ID: <99F60D00-9175-4448-87BB-28CDECDC81D4@jdhuntington.com> I did a bit of looking into how character literals are handled in some other versions of scheme, and thought it might be useful for discussion. As of now, bus-scheme character literals are parsed into one-character strings. However, it appears this is not the case in at least one other scheme implementation. Here's a snippet from PLT: > (char? #\a) #t > (char? "a") #f In bus, the second form is true as well: > (char? #\w) true > (char? "w") true Thoughts? As an aside, I think I'll make a lookup for the "control" characters. I found a list of these for the guile scheme implementation; does this look like an adequate list? http://gnu.cict.fr/software/guile/manual/html_node/Characters.html -JD Huntington From phil at hagelb.org Thu Mar 20 12:13:57 2008 From: phil at hagelb.org (Phil Hagelberg) Date: Thu, 20 Mar 2008 09:13:57 -0700 Subject: [Bus-scheme-discuss] Fwd: Character Literals In-Reply-To: <5F08C562-D802-4C1A-B6CC-F75B73A0853C@jdhuntington.com> (JD Huntington's message of "Wed, 19 Mar 2008 22:17:08 -0700") References: <99F60D00-9175-4448-87BB-28CDECDC81D4@jdhuntington.com> <5F08C562-D802-4C1A-B6CC-F75B73A0853C@jdhuntington.com> Message-ID: <87ve3hxtiy.fsf@hagelb.org> JD Huntington writes: > I did a bit of looking into how character literals are handled in some > other versions of scheme, and thought it might be useful for > discussion. As of now, bus-scheme character literals are parsed into > one-character strings. However, it appears this is not the case in at > least one other scheme implementation. Here's a snippet from PLT: > > (char? #\a) > > #t > > (char? "a") > > #f Bugger it all. I just checked R5RS, and it says (under section 3.2, Disjointness of Types) that "No object satisfies more than one of the following predicates: boolean? pair? symbol? number? char? string? vector? port? procedure?". So the standard is quite clear; it's just a question of whether we want to follow Scheme or Ruby here. I personally prefer Ruby 1.9's approach (Ruby 1.8's being, of course, totally brain-dead). I think we can leave it how it is unless there are objections. -Phil