Pasting multi-line dfns into the session

For users of dfns, both novice and expert

Pasting multi-line dfns into the session

Postby JohnS|Dyalog on Tue Oct 21, 2014 3:51 pm

Andy Shiers showed me a cool trick. If you come across a multi-line dfn in an email or in a web page, you can paste it directly into the Dyalog session, if you surround it with ∇ characters.

For example. Copy the following three lines into the clipboard and paste(-unicode) them into the session.

Code: Select all
dup←{
    ⍵ ⍵
}

But before hitting Return, type ∇ characters fore and aft, like so:

Code: Select all
∇dup←{
    ⍵ ⍵
}∇

... and then hit Return to define the function.
JohnS|Dyalog
 

Re: Pasting multi-line dfns into the session

Postby Phil Last on Tue Oct 21, 2014 5:08 pm

Easier yet: type the two dels first and paste between them.
User avatar
Phil Last
 
Posts: 549
Joined: Thu Jun 18, 2009 6:29 pm


Return to Functional Programming

Who is online

Users browsing this forum: No registered users and 1 guest