Download Jar. Libraryless. Click here for Pure Java version (8423L/58K).
1 | !7 |
2 | |
3 | srecord Did$HappenBefore$(O event1, O event2) {} |
4 | srecord WhenDid$Happen(O event) {} |
5 | srecord $HappensAtSecond$(O event, O y) {} |
6 | |
7 | static ClassesAndPatterns classes; |
8 | sO parseArg(S s) { ret isInteger(s) ? parseInt(s) : s; } |
9 | sO parse (S s) { ret classes.parse(s, lambda1 parseArg); } |
10 | sS unparse (O o) { ret classes.unparse(o); } |
11 | |
12 | p-exp { |
13 | classes = new ClassesAndPatterns(myRecordClasses(), mc()); |
14 | pnl(classes.entries); |
15 | for (S s : ll( |
16 | "Did X happen before Y", |
17 | "when did Z happen", |
18 | "{event 1} happens at second 100")) |
19 | assertEqualsICVerbose(s, print("> ", unparse(parse(s)))); |
20 | } |
Began life as a copy of #1025448
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, mqqgnosmbjvj, omdjrrnzbjjv, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1025452 |
Snippet name: | Propositions to objects, step 7 - unparsing (OK) |
Eternal ID of this version: | #1025452/8 |
Text MD5: | 225950cde2ef7cf2570da45f0da147fb |
Transpilation MD5: | 7da855ceb76afe386ca96079562c664b |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-01-05 14:36:00 |
Source code size: | 617 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 323 / 1080 |
Version history: | 7 change(s) |
Referenced in: | [show references] |