Starting from zero: input and boxed output

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...

Starting from zero: input and boxed output

Postby ejohnso9 on Fri Feb 09, 2018 8:28 am

Hello! I am brand new to APL (though not programming in general). Just trying to spend some time learning this interesting language. I have Dyalog 16 installed on both Mac & Windows.

So, my first question is about special character input. I see how to type things like `i to get iota (⍳) on the Mac, and how to use CTRL-i to get iota (⍳) on Windows. Is there a setting on Windows so I can type `i to get iota there or vice versa?

I see the:
Code: Select all
   ]boxing


command and can turn that on or off to get basic boxes, but was interested to see the decorated display with zero or non-zero axis indicators and so on as documented here: https://dfns.dyalog.com/n_disp.htm

Code: Select all
Compare the output from Dick's functions with the original:

        display 1 'a' 'abc' (2 3⍴⍳6)    ⍝ "standard" display.
    ┌→──────────────────┐
    │     ┌→──┐ ┌→────┐ │
    │ 1 a │abc│ ↓1 2 3│ │
    │   - └───┘ │4 5 6│ │
    │           └~────┘ │
    └∊──────────────────┘

        displays 1 'a' 'abc' (2 3⍴⍳6)   ⍝ with shape along top border.
    ┌→─4────────────────┐
    │     ┌→─3┐ ┌→─2 3┐ │
    │ 1 a │abc│ ↓1 2 3│ │
    │   - └───┘ │4 5 6│ │
    │           └~────┘ │
    └∊──────────────────┘

        displayr 1 'a' 'abc' (2 3⍴⍳6)   ⍝ with shape per axis and depth.
    ┌4────────────────────┐
    │     ┌3───┐ ┌3─────┐ │
    │ 1 a │ abc│ 2 1 2 3│ │
    │   - └────┘ │ 4 5 6│ │
    │            └~─────┘ │
    └¯2───────────────────┘



I guess I am not understanding something about how display and disp work, because I just get error:

Code: Select all
      ⍳2 2
┌───┬───┐
│1 1│1 2│
├───┼───┤
│2 1│2 2│
└───┴───┘
⍝ Seems fine



Code: Select all
   display ⍳2 2
VALUE ERROR
      display⍳2 2
     ∧

⍝ I don't know?




Thanks for the help. Best wishes to all.
-ej
ejohnso9
 
Posts: 4
Joined: Fri Aug 04, 2017 12:41 am

Re: Starting from zero: input and boxed output

Postby Jay|Dyalog on Fri Feb 09, 2018 12:37 pm

Hi ej, and welcome!

Currently the backtick (`i) input system is not available in the standard Windows IDE, though we do have some plans to support it in version 17.0 later this year.

(To be more precise, the plan is to support backtick input in our Windows IME. This means you'll be able to use it in all applications, Outlook and Word and whatnot, not just when you're using the Dyalog APL IDE.)

On the Mac there is a keylayout you can install to get Alt+i input. For more info and installation instructions see:
https://www.dyalog.com/apl-font-keyboard.htm
http://dfns.dyalog.com/n_kbmac.htm

As for disp and display, before you can use them you have to copy or load them from the "dfns" workspace, e.g. with:

Code: Select all
)copy dfns  ⍝ copy everything from dfns.dws into your current workspace


Or:

Code: Select all
)copy dfns disp display  ⍝ just copy those two functions


Regards,
Jay.
Jay|Dyalog
 
Posts: 16
Joined: Mon Aug 09, 2010 10:45 am

Re: Starting from zero: input and boxed output

Postby ejohnso9 on Sun Feb 11, 2018 11:17 pm

Thank you, Jay! ;)
ejohnso9
 
Posts: 4
Joined: Fri Aug 04, 2017 12:41 am


Return to New to Dyalog?

Who is online

Users browsing this forum: No registered users and 1 guest