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

17
LINES

< > BotCompany Repo | #1035429 // IStackWithOptions - base interface for BStack and PStack

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (22767L/140K).

interface IStackWithOptions extends IVStack {
  // declare a choice point for backtracking
  // (or a probabilistic choice point if it's a PStack)
  default <B extends VStack.Computable> void options(B currentFrame, IVF1<B>... options) {
    options(currentFrame, arrayIterator(options));
  }
  
  <B extends VStack.Computable> void options(B currentFrame, Iterable<IVF1<B>> options);
  
  // if options list is empty, return null
  default <B extends VStack.Computable> void optionsOrReturn(B currentFrame, Cl<IVF1<B>> options) {
    if (empty(options))
      _return();
    else
      options(currentFrame, options);
  }
}

Author comment

Began life as a copy of #1035395

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035429
Snippet name: IStackWithOptions - base interface for BStack and PStack
Eternal ID of this version: #1035429/9
Text MD5: ba643f49f23dbb0ed008a1280c293d3b
Transpilation MD5: 4f9c59c0f4b44c77e92c4002c32d6ffe
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-01 23:28:25
Source code size: 640 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 107 / 153
Version history: 8 change(s)
Referenced in: [show references]