Uses 911K of libraries. Click here for Pure Java version (11854L/63K).
1 | !7 |
2 | |
3 | concept User { |
4 | long userID; |
5 | S name; |
6 | bool canEval; |
7 | |
8 | toString { ret userID + "/" + name + stringIfTrue(canEval, " (can eval)"); } |
9 | } |
10 | |
11 | cmodule GUsers > DynCRUD<User> { |
12 | start { |
13 | dbIndexing(User, 'userID); |
14 | updateFromLinesCRUD(); |
15 | } |
16 | |
17 | // API |
18 | |
19 | void updateFromLinesCRUD { |
20 | L l = cast dm_call(dm_gazelle_linesCRUD(), 'conceptsOfType, 'User); |
21 | for (O o : l) |
22 | cset(uniq_sync User(userID := get userID(o)), |
23 | name := get name(o)); |
24 | } |
25 | |
26 | bool canEval(long userID) { |
27 | User u = conceptWhere User(+userID); |
28 | ret u != null && u.canEval; |
29 | } |
30 | |
31 | User userForID(long userID) { |
32 | ret conceptWhere User(+userID); |
33 | } |
34 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1021656 |
Snippet name: | Discord Gazelle: Users |
Eternal ID of this version: | #1021656/6 |
Text MD5: | 43feed2fbf932ea88cf9b266c3da6602 |
Transpilation MD5: | 2e40f511d718c19594493aedd98e52e7 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-14 11:40:57 |
Source code size: | 689 bytes / 34 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 390 / 10084 |
Version history: | 5 change(s) |
Referenced in: | [show references] |