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

34
LINES

< > BotCompany Repo | #1012144 // ai_texts_dollarAny

JavaX fragment (include)

1  
static L<SS> ai_texts_dollarAny(S a, S b, S c) {
2  
  if (isDollarVar(b)) todo();
3  
  bool va = isDollarVar(a), vc = isDollarVar(c);
4  
  new L<SS> l;
5  
  
6  
  // no vars
7  
  if (!va && !vc) {
8  
    if (has(a, b, c)) l.add(emptyMap());
9  
    ret l;
10  
  }
11  
  
12  
  // var on the left
13  
  if (va && !vc) {
14  
    for (S s : ai_texts("$X", b, c))
15  
      l.add(litmap(a, s));
16  
    ret l;
17  
  }
18  
  
19  
  // var on the right
20  
  if (vc && !va) {
21  
    for (S s : ai_texts(a, b, "$X"))
22  
      l.add(litmap(c, s));
23  
    ret l;
24  
  }
25  
  
26  
  // vars on both sides
27  
  for (WebRelation r : indexedRelations(b))
28  
    addIfNotNull(l, strictlitmapOrNull(a, web_text(r.a), c, web_text(r.b)));
29  
  ret l;
30  
}
31  
32  
static L<SS> ai_texts_dollarAny(T3<S> t) {
33  
  ret ai_texts_dollarAny(t.a, t.b, t.c);
34  
}

Author comment

Began life as a copy of #1012112

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: #1012144
Snippet name: ai_texts_dollarAny
Eternal ID of this version: #1012144/6
Text MD5: 6a8b91d03eccaa6cd7f8d6bfe7de7707
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-21 11:41:42
Source code size: 758 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 511 / 557
Version history: 5 change(s)
Referenced in: [show references]