1 | !752 |
2 | |
3 | class Var { |
4 | new Core core; |
5 | Var next; |
6 | |
7 | Lisp get() { |
8 | ret core.value; |
9 | } |
10 | |
11 | boolean set(Lisp value) { |
12 | ret core.set(value); |
13 | } |
14 | |
15 | void unifyWith(Var v) { |
16 | core = v.core; |
17 | } |
18 | } |
19 | |
20 | class Core { |
21 | Lisp value; |
22 | |
23 | boolean set(Lisp val) { |
24 | // existing |
25 | if (value != null) |
26 | ret eq(value, val); |
27 | |
28 | // new |
29 | value = val; |
30 | ret true; |
31 | } |
32 | } |
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: | #1002812 |
Snippet name: | Prolog Variables Test (dev.) |
Eternal ID of this version: | #1002812/1 |
Text MD5: | c50929a797658f109bc480cf88ba8871 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-02-27 01:23:07 |
Source code size: | 408 bytes / 32 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 1087 / 1035 |
Referenced in: | [show references] |