Sorry, I accidentally deleted part of the mail
the “where and why” part is mostly lost.
it also dealt with using /~ and
why it’s no use in this case
(monadic/dyadic meanings of ~);
and the function definition is lost, too.
I’ll only repeat that one:

f =: ,/"1 0
1 2 7 f 30 40

I recommend looking up ~ as well

Am 13.05.20 um 10:35 schrieb Hauke Rehr:
Or, starting from your first approach,
teaching where and why it failed:

1 2 7 ,/"1 0 ] 30 40

you want ,/ to work on a list on the left
and individual atoms on the right
" (rank) does that. It tells the verb
(,/ in this case) to apply to lists (1)
on the left and atoms (0) on the right.

Thus ,/"1 0 does it.
] in effect only separates the list argument 1 0
for " from the list argument 30 40 to ,/"1 0

look up rank (both the concept and the verb ")


hth


Am 13.05.20 um 10:27 schrieb 'Bo Jacoby' via Programming:
  Thank you very much, Esa!
Bo.    Den onsdag den 13. maj 2020 10.18.27 CEST skrev Lippu Esa <[email protected]>:
  Hello Bo,

Is this what you need?

f=:,"_ 0
1 2 7 f 30 40
1 2 7 30
1 2 7 40

Esa
-----Original Message-----
From: Programming <[email protected]> On Behalf Of 'Bo Jacoby' via Programming
Sent: Wednesday, May 13, 2020 11:11 AM
To: Programming Forum <[email protected]>
Subject: [Jprogramming] Please help

How to define a function f such that
   1 2 7 f 30 40
1 2 7 30

1 2 7 40



(,/~  does not work like that.)

Please help. Thanks!
Bo.
----------------------------------------------------------------------
For information about J forums see https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&data=01%7C01%7C%7Cd97ac592c5084860769708d7f7154095%7C5090e269dbea4e98a9aa3e70be5890f7%7C0&sdata=gsABpTxG87KBbQKSxA0TzElDLjWxLw6DX4L7229lNa4%3D&reserved=0

Tämän viestin sisältö liitteineen on luottamuksellinen ja tarkoitettu vain sen vastaanottajalle. Jos et ole viestin tarkoitettu vastaanottaja, pyydämme sinua poistamaan viestin liitteineen ja sen jälkeen ilmoittamaan asiasta välittömästi viestin lähettäjälle. Viestin sisällön paljastaminen, kopioiminen tai muu käyttö on kielletty.

The contents of this message and any attachments are confidential and meant solely for the intended recipient. If you are not the intended recipient, we kindly ask that you delete the message and its attachments, and immediately notify the sender of the email. Disclosing, copying or using the contents of the message is strictly prohibited.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



--
----------------------
mail written using NEO
neo-layout.org

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to