Overtake

This topic is specifically for discussions on the new APL64 Project currently in development. This topic is open for all to browse. However, to post, one must have a registered account on the APLDN forum only available to APL+Win licensee under a current APL+Win Subscription.

Moderators: Tech Support, phpbb_admin

Overtake

Postby Ajay Askoolum » November 3rd, 2018, 6:23 am

Need a function that uses the last element for padding rather than 0, for example,
Code: Select all
      L←8 9 3 4 5
      10↑L
8 9 3 4 5 0 0 0 0 0
      10 {overtake} L
8 9 3 4 5 5 5 5 5 5
      10↑L,10/(0⊥L)
8 9 3 4 5 5 5 5 5 5
Likewise for -ve overtake when it should use the first element.
Ajay Askoolum
 
Posts: 743
Joined: February 22nd, 2007, 2:16 am
Location: United Kingdom

Re: Overtake

Postby Davin Church » November 3rd, 2018, 12:03 pm

I don't often need to pad with something other than the array prototype, but when I do I find it easy enough to code around. For your example I'd probably use something akin to:
Code: Select all
10↑L,10⍴¯1↑L

I do occasionally want to force a particular prototype to pad with, especially if my vector may be empty and I need it to have a particular type/depth. For that I use the alternate form:
Code: Select all
1↓(10+1)↑proto,L
Davin Church
 
Posts: 543
Joined: February 24th, 2007, 1:46 am


Return to APL64 Project

Who is online

Users browsing this forum: No registered users and 1 guest

cron