4,493
edits
(+example usage) |
|||
Line 4: | Line 4: | ||
== Example usage == | == Example usage == | ||
As with other workspaces, workspace <source lang=text inline>dfns</source> can be copied into the current workspace using [[system | As with other workspaces, workspace <source lang=text inline>dfns</source> can be copied into the current workspace using the [[Quad name|system function]] <source lang=apl inline>⎕CY</source>: | ||
<source lang=apl> | <source lang=apl> | ||
⎕CY'dfns' | |||
⍝ Example call: timing an expression using function `cmpx` | ⍝ Example call: timing an expression using function `cmpx` | ||
Line 12: | Line 12: | ||
0.0001302490234375 | 0.0001302490234375 | ||
</source> | </source> | ||
Copying in only one or more specific functions is done by adding a left [[argument]]: | |||
<source lang=apl> | |||
'dec' 'hex'⎕CY'dfns' | |||
hex 1234 | |||
04d2 | |||
dec '04d2' | |||
1234 | |||
</source> | |||
It can also be used to import the entire workspace into a utility [[namespace]]: | |||
<source lang=apl> | <source lang=apl> | ||
{(⍎⍵⎕NS⍬).⎕CY ⍵}'dfns' | {(⍎⍵⎕NS⍬).⎕CY ⍵}'dfns' | ||