سؤال

I'm making a classroom excercise in LISP, and I'm getting this error

CG-USER(286): 
Error: Invalid EXCL::PREDICATE argument:
       #<Vector @ #x20fd488a>
[condition type: SIMPLE-ERROR]

Could you tell me what this is supposed to mean? I'll paste the code giving the error, but it's long and ugly.

It should find the stations following the given one in Madrid's metro network, being ESTACION the name of the station, CAMBIO-ESTACION a list describing short transfers (format: (L01 Sol L02 Tribunal)), VIAS a list describing the order of the stations in the metro lines (format (l01 Sol Opera 1.01)). There are some stations broken (the ones in AVERIADAS) and I have to finde the closes stations (in PROFUNDIDAD-VECINOS jumps).

Obviously, I don't expect you to debug my code (it's a lot of ugly code to read), but it would be great if anyone could tell me what is that error supposed to mean. Thanks.

Here is the code:

This is the execution with the error:

CG-USER(286): (estaciones-cercanas-a 'Noviciado *vias* *cambio-estacion* 2 '(Sol Callao Noviciado Santo_Domingo PLAZA_DE_ESPAÑA SAN_BERNARDO RETIRO))
Error: Invalid EXCL::PREDICATE argument:
       #<Vector @ #x20fd488a>
[condition type: SIMPLE-ERROR]

And this is a successful execution:

CG-USER(288): (estaciones-cercanas-a 'Noviciado *vias* *cambio-estacion*)
(SANTO_DOMINGO SAN_BERNARDO PLAZA_DE_ESPAÑA)
هل كانت مفيدة؟

المحلول

You would need to paste a backtrace.

But as I read it, the error basically says that where Lisp expected a predicate, it got some kind vector data.

Typically this would be because some arguments are in the wrong position.

نصائح أخرى

First function, as the else branch of the if expression, you have

        (remove-duplicates
          (remove-if #(lambda(x)(eq x estacion))
          ...

I suspect you want

        (remove-duplicates
          (remove-if #'(lambda(x)(eq x estacion))
          ...

I.e., a single quote is missing.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top