justinethier / husk-scheme

A full implementation of the Scheme programming language for the Haskell Platform.
http://justinethier.github.io/husk-scheme
MIT License
309 stars 28 forks source link

r7rs mode - case-lambda error #133

Closed justinethier closed 10 years ago

justinethier commented 11 years ago

Receive the following error when attempting to run the case-lambda example from r7rs:

justin@ubuntu:~/Documents/husk-scheme/examples/r7rs$ huski -r7 case-lambda.scm 
Input does not match a macro pattern: (cl ((e) (range 0 e)) ((b e) (do ((r (quote ()) (cons e r)) (e (- e 1) (- e 1))) ((< e b) r))))
justinethier commented 11 years ago

I suspect forms that contain ... . such as below could cause problems:

((cl ((p ::: . tail) . body)

Would a simple fix be to reduce that to ..., or is that too simple?

justinethier commented 10 years ago

Actual fix is based on previous comment. The problem is that the macro subsystem cannot distinguish between . tail and tail ... so it cannot match the actual dotted pair structure. For now the macro has been rewritten to work around this problem.