[Bug-apl] fractional power ¯8⋆÷3

2016-04-12 Thread Xiao-Yong Jin
Hi, With the svn version 719, 8 ¯8⋆÷3 2 0.0 but with the release version 1.5, 8 ¯8⋆÷3 2 1J1.732050808 Best, Xiao-Yong

Re: [Bug-apl] Substring replacement in APL

2016-04-12 Thread Christian Robert
An other way to do that, written some time ago: ⎕cr 'Replace' z←Line Replace patterns;f;t;P;pos ⍝ ⍝ Check what is effectively `Line` ⍝ →((≡Line)≥2)/Enclosed ⍝ Line is an Enclose of things →(2=⍴⍴Line)/Matrix⍝ Line is a Matrix ⍝ ⍝ Do the job, single vector source,

Re: [Bug-apl] Substring replacement in APL

2016-04-12 Thread Jay Foad
replace←{(⍴v)↓∊(⊂v),¨(↑⍴u)↓¨(+\u⍷a)⊂a←u,⍺⊣(u v)←⍵} Jay. On 12 April 2016 at 11:39, Elias Mårtenson wrote: > I had a need to to replace substrings with a replacement, and I'm having a > hard time coming up with an concise solution. What I need to do is this: > > 'foobartestfootest' replace

[Bug-apl] Substring replacement in APL

2016-04-12 Thread Elias Mårtenson
I had a need to to replace substrings with a replacement, and I'm having a hard time coming up with an concise solution. What I need to do is this: 'foobartestfootest' replace 'foo' 'xy' Should yield: 'xybartestxytest' Any suggestions? Regards, Elias