“无效的 EXCL::PREDICATE 参数” Common Lisp 中的错误

发布于 2024-10-08 08:12:32 字数 969 浏览 0 评论 0原文

我正在 LISP 中进行课堂练习,并且收到此错误,

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

您能告诉我这是什么意思吗?我将粘贴给出错误的代码,但它又长又难看。

它应该找到马德里地铁网络中给定车站之后的车站,ESTACION 是车站名称,CAMBIO-ESTACION 是描述短途换乘的列表(格式:(L01 Sol L02 Tribunal)),VIAS 是描述车站顺序的列表地铁线路(格式(l01 Sol Opera 1.01))。有一些电台坏了(AVERIADAS 中的电台),我必须找到关闭的电台(PROFUNDIDAD-VECINOS 跳跃中)。

显然,我不希望您调试我的代码(这是很多难看的代码),但如果有人能告诉我该错误的含义是什么,那就太好了。谢谢。

这是代码:

这是有错误的执行:

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]

这是成功的执行:

CG-USER(288): (estaciones-cercanas-a 'Noviciado *vias* *cambio-estacion*)
(SANTO_DOMINGO SAN_BERNARDO PLAZA_DE_ESPAÑA)

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

枯叶蝶 2024-10-15 08:12:32

您需要粘贴回溯。

但当我读到它时,这个错误基本上表明 Lisp 期望有一个谓词,但它得到了某种向量数据。

通常,这是因为某些参数的位置错误。

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.

翻身的咸鱼 2024-10-15 08:12:32

第一个函数,作为 if 表达式的 else 分支,我

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

怀疑您想要

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

,即缺少单引号。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文