bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Whats a better way to do this?


From: alexweiner
Subject: [Bug-apl] Whats a better way to do this?
Date: Sat, 07 Nov 2015 16:05:11 -0700
User-agent: Workspace Webmail 5.15.9

Hi Bug apl,

Does anyone have a recommendation on how to calculate `result` assuming you have `b` and `subsections` of any length? 

      subsections
┌→─────────────────────────────────────────────────────────────────────┐
│┌→──────────────────────────────────┐ ┌→─────────────────────────────┐│
││┌→──────┐ ┌→────┐ ┌→──────┐ ┌→────┐│ │┌→──────┐ ┌→──┐ ┌→──────┐ ┌→─┐││
│││+sub1:|│ │bloop│ │+sub2:|│ │blech││ ││+sub3:|│ │tap│ │+sub4:|│ │yo│││
││└───────┘ └─────┘ └───────┘ └─────┘│ │└───────┘ └───┘ └───────┘ └──┘││
│└∊──────────────────────────────────┘ └∊─────────────────────────────┘│
└∊∊────────────────────────────────────────────────────────────────────┘
      b
┌→──────────────────┐
│┌→──────┐ ┌→──────┐│
││1 1 2 2│ │1 1 2 2││
│└───────┘ └───────┘│
└∊──────────────────┘
      (1⊃b)⊂1⊃subsections
┌→──────────────────────────────────────┐
│┌→────────────────┐ ┌→────────────────┐│
││┌→──────┐ ┌→────┐│ │┌→──────┐ ┌→────┐││
│││+sub1:|│ │bloop││ ││+sub2:|│ │blech│││
││└───────┘ └─────┘│ │└───────┘ └─────┘││
│└∊────────────────┘ └∊────────────────┘│
└∊∊─────────────────────────────────────┘
      result←((1⊃b)⊂1⊃subsections) ((2⊃b)⊂2⊃subsections)
┌→─────────────────────────────────────────────────────────────────────────────┐
│┌→──────────────────────────────────────┐ ┌→─────────────────────────────────┐│
││┌→────────────────┐ ┌→────────────────┐│ │┌→──────────────┐ ┌→─────────────┐││
│││┌→──────┐ ┌→────┐│ │┌→──────┐ ┌→────┐││ ││┌→──────┐ ┌→──┐│ │┌→──────┐ ┌→─┐│││
││││+sub1:|│ │bloop││ ││+sub2:|│ │blech│││ │││+sub3:|│ │tap││ ││+sub4:|│ │yo││││
│││└───────┘ └─────┘│ │└───────┘ └─────┘││ ││└───────┘ └───┘│ │└───────┘ └──┘│││
││└∊────────────────┘ └∊────────────────┘│ │└∊──────────────┘ └∊─────────────┘││
│└∊∊─────────────────────────────────────┘ └∊∊────────────────────────────────┘│
└∊∊∊───────────────────────────────────────────────────────────────────────────┘
 
⍝⍝⍝
I thought it would have been as simple as b⊂subsections
because they are the same length, but that also yields an error.

      b⊂subsections
DOMAIN ERROR
      b⊂subsections
      ^ ^




Any suggestions welcomed,
Alex

reply via email to

[Prev in Thread] Current Thread [Next in Thread]