trusted
69
edits
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com") Tags: Mobile edit Mobile web edit |
(→Debugging: new section) |
||
Line 56: | Line 56: | ||
Only [[dzaima/APL]] allows <source lang=apl inline>(A h)</source>, which it treats as <source lang=apl inline>A∘h</source>.<ref>dzaima/APL: [https://github.com/dzaima/APL/blob/ceea05e25687988ed0980a4abf4b9249b736543f/docs/differences.txt#L19 Differences from Dyalog APL]. Retrieved 09 Jan 2020.</ref> See [[Bind]]. | Only [[dzaima/APL]] allows <source lang=apl inline>(A h)</source>, which it treats as <source lang=apl inline>A∘h</source>.<ref>dzaima/APL: [https://github.com/dzaima/APL/blob/ceea05e25687988ed0980a4abf4b9249b736543f/docs/differences.txt#L19 Differences from Dyalog APL]. Retrieved 09 Jan 2020.</ref> See [[Bind]]. | ||
== Debugging == | |||
In [[Dyalog APL]], analysis of trains is assisted by a [[user command]] <source lang=apl inline>]Boxing on</source>. This is achieved by executing the command <source lang=apl inline>]Boxing on</source> and then entering a train without any parameters. A structure of the train will be displayed. | |||
For example, the "accursed train" from the section below can be analyzed like this: | |||
<source lang=apl> | |||
]Boxing on | |||
┌→──────┐ | |||
│Was OFF│ | |||
└───────┘ | |||
((+.×⍨⊢~∘.×⍨)1↓⍳) ⍝ the train to be analysed | |||
┌───────────────────────────────┬───────┐ | |||
│┌───────────┬─────────────────┐│┌─┬─┬─┐│ | |||
││┌───────┬─┐│┌─┬─┬───────────┐│││ │↓│⍳││ | |||
│││┌─┬─┬─┐│⍨│││⊢│~│┌───────┬─┐││││1│ │ ││ | |||
││││+│.│×││ │││ │ ││┌─┬─┬─┐│⍨│││││ │ │ ││ | |||
│││└─┴─┴─┘│ │││ │ │││∘│.│×││ ││││└─┴─┴─┘│ | |||
││└───────┴─┘││ │ ││└─┴─┴─┘│ ││││ │ | |||
││ ││ │ │└───────┴─┘│││ │ | |||
││ │└─┴─┴───────────┘││ │ | |||
│└───────────┴─────────────────┘│ │ | |||
└───────────────────────────────┴───────┘ | |||
</source> | |||
Alternatively, a train can be represented in form of a tree: | |||
<source lang=apl> | |||
]Boxing on -trains=tree | |||
┌→─────────────────┐ | |||
│Was ON -trains=box│ | |||
└──────────────────┘ | |||
((+.×⍨⊢~∘.×⍨)1↓⍳) ⍝ the train to be analysed | |||
┌───┴───┐ | |||
┌─┴─┐ ┌─┼─┐ | |||
⍨ ┌─┼─┐ 1 ↓ ⍳ | |||
┌─┘ ⊢ ~ ⍨ | |||
. ┌─┘ | |||
┌┴┐ . | |||
+ × ┌┴┐ | |||
∘ × | |||
</source> | |||
== Examples == | == Examples == |