I see that use case for fcase as implementing a defcon level: "Do all the 
actions of lower level alerts at higher levels"

pcase would also do that more flexibly at the cost of specifying the 
duplication.  In your example, the fcase. lines if implemented with pcase. 
would be switched to

pcase. 5;4;3;2;1

pcase. 4;3;2;1
pcase. 3;2;1
pcase. 2;1
pcase. 1

I agree that pcase is a marginal proposal.  It just seems less marginal than 
fcase.



----- Original Message -----
From: bill lam <[email protected]>
To: 'Pascal Jasmin' via Programming <[email protected]>
Sent: Thursday, March 2, 2017 3:00 AM
Subject: Re: [Jprogramming] fcase.

fcase is used occasionally in base library and addons.
eg.

select. Show >. {. y,0
fcase. 5 do.
  initmisc''
  inithier''
  initflip''
  initzoom''
  initrange''
  initcube''
fcase. 4 do.
  if. GridVirtualMode > Hier do.
    getdata'' return.
  end.
fcase. 3 do.
  initxywh ''
  initaxes''
  initdata''
  initcell''
  initheader''
  initextents''
fcase. 2 do.
  getfmt ''
  getextent''
fcase. 1 do.
  initsizes''
end.

5 executes all blocks while 1 executes only the last block.

your purposed pcase works if switch labels are duplicated which
is rare if not illegal.

Чт, 02 мар 2017, jprogramming написал(а):
> Do not see the usefulness of the fcase. option.  see example here:  
> http://www.jsoftware.com/help/dictionary/csel.htm
> 
> 
> I would see a "passthrough case" pcase. usefulness
> 
> f2=: 3 : 0
> t=. ''
> select. y
> case.  1 do. t=.t,'one '
> pcase. 2 do. t=.t,'two '
> case.  2;3 do. t=.t,'three '
> case. 2;3;4 do. t=.t,'four '
> end.
> )
> 
> f2 2
> two three 
> 
> a pcase. statement would not abort search after a match.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3

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

Reply via email to