lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme error message


From: Urs Liska
Subject: Re: Scheme error message
Date: Fri, 22 Apr 2016 08:05:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0

Hi Andrew,

thank you for these explanations. I wouldn't have thought of trying the
construct in another Scheme implementation (although Racket should still
be installed somewhere on my PC ...).

So it more or less boils down to a syntax error that Guile doesn't
really understand. Maybe because the (1 . 2) looks somewhat like an
improper list to the parser?

Anyway, now I'm closer to provide a proper explanation (you know where).

Best

Urs


Am 22.04.2016 um 03:04 schrieb Andrew Bernard:
> 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]