J@没有按预期工作
我刚刚开始尝试学习 J 语言,并对以下内容感到困惑:
1 2 +/@{ i.4
1 2
+/ 1 2 { i.4
3
当 @ 的文档中显示:“xu@vy ↔ uxv y”时,
我认为我只是将某个词性误认为是另一个,但也无法弄清楚
,我如何判断一个名字是什么类型的演讲?
I'm just starting to try to pick up the J language, and am confused by the following:
1 2 +/@{ i.4
1 2
+/ 1 2 { i.4
3
when in the documentation for @ it says: "x u@v y ↔ u x v y"
I assume I'm just mistaking one part of speech for another, but can't figure it out
also, how do I tell what type of speech a name is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在我的偏见中,维基百科对排名以及它在 J 中“语音”的不同部分的上下文中的含义进行了不错的描述。
但是为了回答最初的问题,J 的跟踪工具对于理解其语法如何很有用有效:
这将引导您逐步完成解析过程,显示每个产生规则所消耗的单词以及每个产生的结果。
Wikipedia has, in my biased opinion, a decent writeup on rank, and what it means in the context of the different parts of "speech" in J.
But to answer the original question, J's trace facility can be useful for understanding how its grammar works:
This will take you step by step through the parsing process, showing the words being consumed by each production rule and the result each generates.
啊,我想我可能已经弄清楚了,我需要使用@:而不是@,
这就是我想要的。 我想我得再读一些关于等级的内容,这是@和@之间的唯一区别:
Ah, I think I may have figured it out, I need to use @: instead of @
which is what I wanted. Guess I'm going to have to read up some more on rank, which is the only difference between @ and @: