Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1028835 // withDeepReturn - like withCancelPoint, but allowing a return value

JavaX fragment (include)

static <A> A withDeepReturn(IVF1<DeepReturnSite<A>> r) {
  temp new DeepReturnSite<A> site;
  try {
    r.get(site);
  } catch e {
    e = innerException(e);
    if (e instanceof DeepReturn && e/DeepReturn.site == site)
      ret site!;
    else
      rethrow(e);
  }
  null;
}

Author comment

Began life as a copy of #1018342

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028835
Snippet name: withDeepReturn - like withCancelPoint, but allowing a return value
Eternal ID of this version: #1028835/2
Text MD5: c750b1ada090c2b9f972ccfdffe07cab
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-09 15:25:09
Source code size: 289 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 143 / 172
Version history: 1 change(s)
Referenced in: [show references]