home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.scheme
- Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!thinman
- From: thinman@netcom.com (Technically Sweet)
- Subject: Scheme type checking
- Message-ID: <1993Jan6.212720.21082@netcom.com>
- Organization: International Foundation for Internal Freedom
- References: <1idc0eINNak2@fido.asd.sgi.com>
- Date: Wed, 6 Jan 1993 21:27:20 GMT
- Lines: 27
-
- A deeper issue here is that in Scheme, the truly
- interesting types are not the defined ones but
- list structures which you define. I would like
- to have a list structure grammar, for example:
-
- List of pairs: (list (atom? . atom?) '*)
- List of (number . string): (list (number? . string?) '*)
-
- And a routine which takes the grammar and an argument list
- and returns #t/#f for legality. Better yet, I'd like to
- receive an error diagnostic (given the latter grammar):
-
- '((3 . "a") (4 . "b") ("c" . "d")) -> '(1 1 0 0)
-
- which shows the list-walk necessary to find the erroneous
- car or cdr location.
-
- A grammar for tree structures would be more complex than the one above.
- I have no idea how to do a grammar for self-referential lists.
-
- Is something like this available for Common Lisp or Scheme?
-
- --
-
- Lance Norskog
- thinman@netcom.com
- Data is not information is not knowledge is not wisdom.
-