-
Couldn't load subscription status.
- Fork 22
1.1 Creating content
Note: This only applies to offline usage.
Click on any code cell to begin editing it, then press Ctrl+Enter to execute the code.
Use the ➕︎ button to insert a new code cell. You can switch a cell contain explanations, comments, etc. by selecting Markdown from the drop-down saying Code∨. Additional commands can be found by clicking the ⌨︎ button.
Single-line dfns and tacit functions may be defined among other code in a code cell:
AddNext←{⍵,+/¯2↑⍵}
Fibonacci←AddNext/⌽∘⍳
Fibonacci 10Note: Tradfns; multi-line dfns; and scripted :Namespaces, :Classes and :Interfaces must be defined in a single code cell.
Tradfns may be defined in a code cell by beginning the first line with a ∇ and having a sole ∇ after the last line:
∇Greet name
⎕←'Hello, ',name
∇To define a multi-line dfn, begin a code cell with the line ]dinput. For example:
]dinput
root←{
⍺←2
⍵*÷⍺
}To define a scripted :Namespace, :Class or :Interface, begin and end the code cell with the corresponding :Keyword and :EndKeyword. For example;
:Namespace myns
∇Greet name
⎕←'Hello, ',name
∇
:EndNamespaceYou can indicate that the result of a statement should be rendered as HTML by using the ]html user command:
p←'<p>Please:</p>'
b←'<button onclick="alert(''Thank you!'')">Click</button>'
]html p,bYou can plot data with with the ]plot user command:
x←(⍳100)÷20
y←(⊢*÷)x
]plot y xChoose chart type with the -type= modifier:
]plot 3 1 4 1 6 -type=pieNext ▸
Quick links: Dyalog APL Anaconda Kernel Ready-made notebooks Viewer Email us