[plt-scheme] Advanced Student Language (HtDP)

From: Daniel King (danking at ccs.neu.edu)
Date: Tue Mar 23 22:36:57 EDT 2010

The `case` form in the Advanced Student Language rejects dispatch over
characters such as:

(case #\a
  ((#\b) "You chose b!")
  ((#\a) "You chose a!"))

Is this a feature?  #lang scheme allows me to use the character type,
and I'd like to use it in ASL.

Furthermore, I tried adding

(require (rename-in scheme [case char-case]))
(provide char-case)

to a lib.ss file and then adding

(require "lib.ss")

to the ASL file, which seems to allow character dispatch, but then it
complains that an else clause is

bad syntax (not a datum sequence)

Any idea how I can get this working?


Dan King
College of Computer and Information Science
Northeastern University
danking at ccs.neu.edu

Posted on the users mailing list.