home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / scheme / 2877 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.2 KB  |  38 lines

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