Libraryless. Compilation Failed (16746L/101K).
// TODO: use weak reference to live value - or make each of them only once static SimpleLiveValue dm_fieldLiveValue(DynModule module default dm_current_mandatory(), S fieldName) { lock module.lock; temp module.enter(); // for dm_watchField Class type = getFieldType(module, fieldName); final SimpleLiveValue value = new(type, get(module, fieldName)); dm_watchField(fieldName, r { ifdef dm_fieldLiveValue_debug print("dm_fieldLiveValue: setting " + fieldName); endifdef O o = get(module, fieldName); ifdef dm_fieldLiveValue_debug print("dm_fieldLiveValue: setting " + fieldName + " = " + o); endifdef value.set(o); ifdef dm_fieldLiveValue_debug print("dm_fieldLiveValue: setting " + fieldName + " done"); printStackTrace(); endifdef }); value.onChange(r { ifdef dm_fieldLiveValue_debug print("dm_fieldLiveValue: setting 2 " + fieldName + " = " + value!); endifdef module.setField(fieldName, value!); ifdef dm_fieldLiveValue_debug print("dm_fieldLiveValue: setting 2 " + fieldName + " done"); endifdef }); ret value; } static SimpleLiveValue dm_fieldLiveValue(S fieldName, DynModule module) { ret dm_fieldLiveValue(module, fieldName); }
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1015971 |
Snippet name: | dm_fieldLiveValue - live-value for a field in DynModule. should also work with transient fields |
Eternal ID of this version: | #1015971/19 |
Text MD5: | 3347e7cafefa2ca274688b5d7dd1a50c |
Transpilation MD5: | 818ed4290d9711abe09efa8376e1507a |
Author: | stefan |
Category: | javax / stefan's os |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-01-29 04:20:00 |
Source code size: | 1279 bytes / 36 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 558 / 707 |
Version history: | 18 change(s) |
Referenced in: | [show references] |