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

14
LINES

< > BotCompany Repo | #1012352 // ai_triplesToWebNodes_lazyList

JavaX fragment (include)

static L<WebNode> ai_triplesToWebNodes_lazyList(final Symbol searchTerm, final L<TripleWeb> l) {
  ret new LazyList<WebNode>() {
    final int n = l(l);
    public int size() { ret n; }
    public WebNode get(int i) {
      TripleWeb w = syncGet(l, i);
      if (w == null) null;
      int runLength = 0;
      while (i-runLength > 0 && l.get(i-runLength-1) == w)
        ++runLength;
      ret ai_tripleToWebNode(l.get(i), searchTerm, runLength);
    }
  };
}

Author comment

Began life as a copy of #1012335

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012352
Snippet name: ai_triplesToWebNodes_lazyList
Eternal ID of this version: #1012352/8
Text MD5: a7537997060165a19b6e796b63556f71
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-10 07:24:12
Source code size: 473 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 375 / 411
Version history: 7 change(s)
Referenced in: [show references]