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

28
LINES

< > BotCompany Repo | #1001740 // talkToAllOtherVMs

JavaX fragment (include)

static Iterable<DialogIO> talkToAllOtherVMs() {
  final L<ProgramScan.Program> list = quickBotScan("This is a JavaX VM.");
  int myPort = myVMPort();
  for (int i = 0; i < l(list); i++)
    if (list.get(i).port == myPort) {
      list.remove(i);
      break;
    }
  
  return new Iterable<DialogIO>() {
    public Iterator<DialogIO> iterator() {
      return new Iterator<DialogIO>() {
        int i;
        
        public boolean hasNext() {
          return i < list.size();
        }
        
        public DialogIO next() {
          return talkTo(list.get(i++).port);
        }
        
        public void remove() {
        }
      };
    }
  };
}

Author comment

Began life as a copy of #1001399

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: #1001740
Snippet name: talkToAllOtherVMs
Eternal ID of this version: #1001740/1
Text MD5: 2212603e13ba48a576c94b10eede25cb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-11-11 01:37:16
Source code size: 685 bytes / 28 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 562 / 789
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#3000202 - Answer for stefanreich (>> T conversion bot)
#3000238 - Answer for stefanreich (>> t power bot)
#3000382 - Answer for ferdie (>> t = 1, f = 0)