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

48
LINES

< > BotCompany Repo | #1007981 // Thought Bubble 1 prelude 6: Hygienic recurse

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (10624L/73K).

1  
!7
2  
3  
sS stuffToParse = [[
4  
  1
5  
  1 + 2
6  
  (5)
7  
  2 * (3)
8  
  1 * (2 + 3)
9  
  (1 + 2) * 3
10  
  (1 + 2) * (3 + 4)
11  
  1 + 2 * 3
12  
  1 * 2 + 3
13  
]];
14  
15  
sS concepts = [[
16  
  ["jcnbmtmfzktxhzyf", "X + Y"],
17  
  ["bwqhmnorjpyomdbv", "X * Y", "multiplication"],
18  
  ["mcoswmplpqlieruo", "(X)"],
19  
  ["olphazqzxxnvtjcx", "X evaluates through standard function Y."],
20  
  ["wwaprwlmqzqeaikp", "A leaf satisfying standard function X evaluates through standard function Y."],
21  
  ["hkihrqgdlkdayxzn", "X is just bracketing."],
22  
]];
23  
24  
sS statements = [[
25  
  olphazqzxxnvtjcx jcnbmtmfzktxhzyf "plus"
26  
  olphazqzxxnvtjcx bwqhmnorjpyomdbv "multiply"
27  
  hkihrqgdlkdayxzn mcoswmplpqlieruo
28  
  wwaprwlmqzqeaikp "isInteger" "bigint"
29  
]];
30  
31  
p-tt {
32  
  centerHigherConsole();
33  
  useConceptsAndCLStatements(concepts, statements);
34  
  //set englishToConceptLanguage_xyz_debug;
35  
  for (S line : toLinesFullTrim(stuffToParse))
36  
    testParse(line);
37  
}
38  
39  
svoid testParse(S s) {
40  
  Lisp l = hygienicParse1(s);
41  
  S result = null;
42  
  if (l != null) result = str(eval(l));
43  
  printIndent(s + " = " + or(result, "?"));
44  
  if (l != null) printIndent(l);
45  
  print();
46  
}
47  
48  
static O eval(Lisp l) { ret generalLispEval(l); }

Author comment

Began life as a copy of #1007978

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: #1007981
Snippet name: Thought Bubble 1 prelude 6: Hygienic recurse
Eternal ID of this version: #1007981/15
Text MD5: 57c05ee98206bdacf33edca3e5a309b5
Transpilation MD5: 9f84e740887550118fd6beea52c35c8f
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-18 02:23:21
Source code size: 1176 bytes / 48 lines
Pitched / IR pitched: No / No
Views / Downloads: 630 / 1251
Version history: 14 change(s)
Referenced in: [show references]