How to automatically ]display variables?
9 posts
• Page 1 of 1
How to automatically ]display variables?
Hi,
I've seen in the Dyalog APL screencast (Depth-first search in APL) that the entered variables to interpreter were presented automatically with ]display. How can I configure my interpreter to behave the same way, so I don't need to write ]display all the time?
I've seen in the Dyalog APL screencast (Depth-first search in APL) that the entered variables to interpreter were presented automatically with ]display. How can I configure my interpreter to behave the same way, so I don't need to write ]display all the time?
- alexeyv
- Posts: 56
- Joined: Tue Nov 17, 2015 4:18 pm
Re: How to automatically ]display variables?
Try user command ]BOXING (which can be abbreviated to ]BOX
]?boxing
Command "output.Boxing". Syntax: 1 argument or less.
Accepts switches -chars= -fns= -style= -trains=
Switch 'chars' accepts only values "regular", "ascii"
Switch 'fns' accepts only values "off", "on"
Switch 'style' accepts only values "min", "mid", "max"
Switch 'trains' accepts only values "box", "tree", "parens"
Boxing of default nested output
Script location: C:\Program Files\Dyalog\Dyalog APL-64 14.0 Unicode\SALT\Spice\output
]?box
Command "output.Box". Syntax: 1 argument or less.
Accepts switches -chars= -fns= -style= -trains=
Switch 'chars' accepts only values "regular", "ascii"
Switch 'fns' accepts only values "off", "on"
Switch 'style' accepts only values "min", "mid", "max"
Switch 'trains' accepts only values "box", "tree", "parens"
Boxing of default nested output
Script location: C:\Program Files\Dyalog\Dyalog APL-64 14.0 Unicode\SALT\Spice\output
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: How to automatically ]display variables?
Awesome, thanks! Is where any way to set ']boxing on' as a default behavior for the interpreter?
- alexeyv
- Posts: 56
- Joined: Tue Nov 17, 2015 4:18 pm
Re: How to automatically ]display variables?
If you're using Dyalog on a (Windows) PC, you can save the current state of ]boxing by selecting Session->Save from the menu bar. This state will then be in effect next time you start Dyalog.
- JohnS|Dyalog
Re: How to automatically ]display variables?
Thanks, I'm on OSX. I would like to have it as a default value for all my workspaces. Probably some magic option in .dyalog/dyalog.config ?
- alexeyv
- Posts: 56
- Joined: Tue Nov 17, 2015 4:18 pm
Re: How to automatically ]display variables?
There's probably a more straightforward way that this but my invocation of Dyalog always loads the same ws and the ⎕LX sets various things for the session. You might not know that most if not all user commands can be run as:
Personally I find there is a number of circumstances where I want to switch it off and as I have quite a long command to set it on I put it on a PFKey:
⎕SE.UCMD 'string'
where string is exactly what you'd type after the square bracket ] in the session but with quotes doubled of course.Personally I find there is a number of circumstances where I want to switch it off and as I have quite a long command to set it on I put it on a PFKey:
boxing ON -style=max -trains=parens -fns=off -chars=asciithat is set by the ⎕LX in my initial )LOAD.
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: How to automatically ]display variables?
When APL starts it reloads the latest version of SALT and User Commands from disk (there is a copy in the session file under Windows but just to be sure...)
The last thing it does after reloading it is execute the user command ]usetup
This cmd allows you to customize your session before it starts.
You could use it to set up PFkeys of even set ]box on.
Have a look at ]??usetup for an example.
The last thing it does after reloading it is execute the user command ]usetup
This cmd allows you to customize your session before it starts.
You could use it to set up PFkeys of even set ]box on.
Have a look at ]??usetup for an example.
- DanB|Dyalog
Re: How to automatically ]display variables?
A couple of ]boxing tips:
1. If you like to run with ]boxing on but occasionally want to see unboxed output, place a ⍕ (format) to the left of the line:
1. If you like to run with ]boxing on but occasionally want to see unboxed output, place a ⍕ (format) to the left of the line:
⍳⍳2 ⍝ with boxing on2. Notice that the output from ]box ? is in a format suitable for typing over and re-submitting, in order to change preferences:
┌───┬───┐
│1 1│1 2│
└───┴───┘
⍕ ⍳⍳2 ⍝ one-time unboxed output
1 1 1 2
++++ ⍝ function train
┌─┬───────┐
│+│┌─┬─┬─┐│
│ ││+│+│+││
│ │└─┴─┴─┘│
└─┴───────┘
]box ?
]boxing ON -style=min -trains=box -fns=off -chars=regular
]boxing ON -style=min -trains=tree -fns=off -chars=regular
Was ON -style=min -trains=box -chars=regular -fns=off
++++ ⍝ function train
┌─┴─┐
+ ┌─┼─┐
+ + +
- JohnS|Dyalog
Re: How to automatically ]display variables?
Thanks for all answers! It still however looks a little 'hackish', or, in other words, too advanced for beginner user who just wants to have a more convenient output. Is where a reason why options like this could not be simple configuration options in the config file?
- alexeyv
- Posts: 56
- Joined: Tue Nov 17, 2015 4:18 pm
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group