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

38
LINES

< > BotCompany Repo | #1007978 // Thought Bubble 1 prelude 6: Bracket hygiene

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

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

!7

sS concepts = [[
  ["jcnbmtmfzktxhzyf", "X + Y"],
  ["bwqhmnorjpyomdbv", "X * Y", "multiplication"],
  ["mcoswmplpqlieruo", "(X)"],
  ["olphazqzxxnvtjcx", "X evaluates through standard function Y."],
  ["wwaprwlmqzqeaikp", "A leaf satisfying standard function X evaluates through standard function Y."],
  ["hkihrqgdlkdayxzn", "X is just bracketing."],
]];

sS statements = [[
  olphazqzxxnvtjcx jcnbmtmfzktxhzyf "plus"
  olphazqzxxnvtjcx bwqhmnorjpyomdbv "multiply"
  hkihrqgdlkdayxzn mcoswmplpqlieruo
  wwaprwlmqzqeaikp "isInteger" "bigint"
]];

p-tt {
  centerHigherConsole();
  useConcepts(concepts);
  useFacts_cl(statements);
  //set englishToConceptLanguage_xyz_debug;
  printIndent(fromLines(sortByArgumentHygiene(parseMulti(print("1")));
  printIndent(fromLines(sortByArgumentHygiene(parseMulti(print("(5)")));
  printIndent(fromLines(sortByArgumentHygiene(parseMulti(print("2 * (3)")));
  printIndent(fromLines(sortByArgumentHygiene(parseMulti(print("1 * (2 + 3)")));
  printIndent(fromLines(sortByArgumentHygiene(parseMulti(print("(1 + 2) * 3")));
  printIndent(fromLines(sortByArgumentHygiene(parseMulti(print("(1 + 2) * (3 + 4)")));
  printIndent(fromLines(sortByArgumentHygiene(parseMulti(print("1 + 2 * 3")));
  printIndent(fromLines(sortByArgumentHygiene(parseMulti(print("1 * 2 + 3")));
}

static L<Lisp> parseMulti(S s) {
  ret englishToLispWith_multi(s, ll("mcoswmplpqlieruo", "jcnbmtmfzktxhzyf", "bwqhmnorjpyomdbv"));
}

static O eval(Lisp l) { ret generalLispEval(l); }

Author comment

Began life as a copy of #1007970

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: #1007978
Snippet name: Thought Bubble 1 prelude 6: Bracket hygiene
Eternal ID of this version: #1007978/4
Text MD5: a9e110c9e222134aedc446598c38df5f
Transpilation MD5: 3724996572e092c5be1b53c1c3a61f55
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 01:46:51
Source code size: 1531 bytes / 38 lines
Pitched / IR pitched: No / No
Views / Downloads: 563 / 1250
Version history: 3 change(s)
Referenced in: [show references]