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

13
LINES

< > BotCompany Repo | #1016244 // dm_universalSearch

JavaX fragment (include)

1  
// pairs of (result, module id)
2  
static L<Pair<O, S>> dm_universalSearch(S query) {
3  
  new L<Pair<O, S>> out;
4  
  for (O m : dm_listModules()) pcall {
5  
    L result = cast callOpt(m, 'uSearch, query);
6  
    if (nempty(result)) {
7  
      S id = dm_moduleID(m);
8  
      for (O s : takeFirst(3, result))
9  
        out.add(pair(s, id));
10  
    }
11  
  }
12  
  ret out;
13  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016244
Snippet name: dm_universalSearch
Eternal ID of this version: #1016244/6
Text MD5: 451516d7ad69db1a66d63b548a5e27d2
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-11 20:00:20
Source code size: 354 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 386 / 427
Version history: 5 change(s)
Referenced in: [show references]