marcomaggi / vicare

A native compiler for Scheme compliant with R6RS
http://marcomaggi.github.com/vicare.html
Other
200 stars 34 forks source link

"more expected arguments than given operands" on `chi-application` #73

Closed okuoku closed 9 years ago

okuoku commented 9 years ago

Hi, I'm preparing Scheme language porting layer yuni for next release of nmosh(0.2.8) and willing to support Vicare as one of supported scheme implementation (so we can run nmosh scripts on vicare too).

yuni has a simple (and braindead) object system called miniobj which written in R5RS/R7RS styled syntax-rules but it seems Vicare's expander cannot expand it correctly:

oku@studio:~/repos/yuni$ run/vicare.sh _sanity.sps
*** Vicare: unhandled exception:
 Condition components:
   1. &who: chi-application
   2. &message: "more expected arguments than given operands"
   3. &syntax:
       form: #<syntax expr=(scan-slot minitype-slot) mark*=(top) line=92 column=18 source=/home/oku/repos/yuni/lib/yuni/miniobj/minitype.sls>
       subform: #f
   4. &expected-arguments-count: 2
   5. &given-operands-count: 1
   6. &source-position:
       port-id: "/home/oku/repos/yuni/lib/yuni/miniobj/minitype.sls"
       byte: 2493
       character: 2493
       line: 92
       column: 18
   7. &macro-expansion-trace: #<syntax expr=(scan-slot minitype-slot) mark*=(top) line=92 column=18 source=/home/oku/repos/yuni/lib/yuni/miniobj/minitype.sls>

Vicare: vicare-scheme-0.4d0pre1.tar.xz Yuni: https://github.com/okuoku/yuni/commit/c6738d8863eba36ebba4db151d0d574b22d9962f OS: Ubuntu studio 14.04

To reproduce:

  1. Install latest Mosh-scheme ( http://storage.osdev.info/pub/mosh/mosh-current.tar.gz )
  2. Checkout yuni repository ( https://github.com/okuoku/yuni )
  3. run run/buildstub.sh on yuni repository's top directory
  4. run run/vicare.sh _sanity.sps

... yuni is currently under heavy development and it would be difficult to read because i'm too lazy to do any cosmetics; please, please feel free ask me to try out any Vicare patches if needed.

okuoku commented 9 years ago

Ooops! It was just a bogus code of mine..

Fixed yuni as https://github.com/okuoku/yuni/commit/8da0cbe1e5d6124990c7f8a06dd9311009018464

Chez gave me:

oku@spring ~/repos/yuni
$ run/petite.sh _sanity.sps
Petite Chez Scheme Version 8.4
Copyright (c) 1985-2011 Cadence Research Systems

Warning in compile: possible incorrect argument count in call (scan-slot minitype-slot) at line 92, char 18 of lib/yuni/miniobj/minitype.sls
Warning in compile: possible incorrect argument count in call (scan-slot minitype-slot) at line 99, char 18 of lib/yuni/miniobj/minitype.sls
Test: 3/3 passed.

and it would be fantastic if Vicare also tell me this somewhat instructive message..

I'll mark this as closed. Sorry!

marcomaggi commented 9 years ago

I see the same informations in Chez's message and Vicare's message: error description, offending form, file name, line number, column number. Do no get deceived by the &who condition object. Maybe the &message should begin with wrong number of arguments in function application.