lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scheme error message


From: Andrew Bernard
Subject: Re: Scheme error message
Date: Fri, 22 Apr 2016 11:04:07 +1000
User-agent: Microsoft-MacOutlook/f.15.1.160411

Hi Urs,

I’d say it is poor error reporting on the part of guile. (Oh no, I’m not starting that again! :-))

If you look at what racket says in these cases, which is clear, you can see tha guile makes a poor job of explaining to the user in your example. No wonder you are confused by guile.

racket:

> (1 2 3)
application: not a procedure;
 expected a procedure that can be applied to arguments
  given: 1
  arguments...:
   2
   3
  context...:
   /home/andro/racket/collects/racket/private/misc.rkt:87:7
> (1 . 2)
stdin::40: application: bad syntax
  in: (1 . 2)
  context...:
   /home/andro/racket/collects/racket/private/misc.rkt:87:7


Something I notice is that you get an ABORT which is presumably the result of an error having been thrown, and guile does not have an appropriate key for this so they just use the wrong number of arguments key. There needs to be a key ‘bad syntax’ to throw for this error. That would be better.

In guile 2 we get:

scheme@(guile-user)> (1 2 3)
ERROR: In procedure 1:
ERROR: Wrong type to apply: 1

scheme@(guile-user)> (1 . 2)
While compiling _expression_:
ERROR: Syntax error:
unknown file:1:0: source _expression_ failed to match any pattern in form (1 . 2)

So this has been addressed in guile 2.

Andrew



reply via email to

[Prev in Thread] Current Thread [Next in Thread]