我刚开始尝试拿起歼语言,和我通过以下困惑:

   1 2 +/@{ i.4
1 2
   +/ 1 2 { i.4
3

当在文档中为@它表示: “X U @ vÿ↔üx垂直Y”

我想我只是误演讲另一个的一部分,但不能弄明白

另外,我怎么告诉一个名字是什么类型的言论?

有帮助吗?

解决方案

   NB. u b. 0 returns the rank of u
   NB. the rank of a verb determines the arguments it applies to at a time
   NB. monadic + y applies to atoms; dyadic x + y applies to pairs of atoms
   + b. 0
0 0 0
   NB. monadic +/ y and dyadic x +/ y apply to anything (unbounded rank)
   +/ b. 0
_ _ _
   NB. monadic { y applies to arrays of atoms;
   NB. dyadic x { y applies to pairs of atoms and anything
   { b. 0
1 0 _
   NB. u @ v has the rank of v
   +/@{ b. 0
1 0 _
   NB. since 1 2 { i.4 returns atoms at a time, +/ works on atoms
   +/"0 [ 1 2 { i.4
1 2
   NB. u @: v has unbounded rank
   +/@:{ b. 0
_ _ _
   NB. +/ applies to all of 1 2 { i.4 at once
   +/"_ [ 1 2 { i.4
3

   NB. mechanical translation to tacit form
   13 : '+/ x { y'
[: +/ {

其他提示

维基百科,在我的偏见的意见,秩一个体面的书面记录,这意味着什么在“讲话”的不同部分以J上下文。

但要回答原来的问题,它的语法是如何工作的J的跟踪工具可以有助于理解:

   require'trace'
   trace '1 2 +/@{ i.4'

这将带你通过解析过程一步一步,示出了由每个生产规则,并且每个产生的结果被消耗的话。

嗯,我想我可能已经想通了,我需要使用@:代替@

   1 2 +/@:{ i.4
3

这就是我想要的。猜猜我将不得不阅读了更多的秩一些,这是@之间唯一的不同@:

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top