Libraryless. Click here for Pure Java version (6213L/35K).
1 | sclass Tok_SettableWithChangeFields > Tok_SettableOrGettableFields {
|
2 | *() { super("settableWithChange"); }
|
3 | *(S keyword) { super(keyword); }
|
4 | |
5 | S replacement() {
|
6 | ret tok_formatDollarVars( |
7 | "$fMod selfType $var aka $setVar($type $var) { if (!eq(this.$var, $var)) { this.$var = $var; change(); } this; }\n"
|
8 | + "gettable $modifiers $type", |
9 | fMod := joinWithSpace(functionModifiers()) + " public", |
10 | modifiers := joinWithSpace(modifiers), |
11 | +type, +var, |
12 | setVar := "set" + firstToUpper(var)); |
13 | } |
14 | } |
Began life as a copy of #1033794
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1034142 |
| Snippet name: | Tok_SettableWithChangeFields |
| Eternal ID of this version: | #1034142/4 |
| Text MD5: | 4a47bd59b8dede939be938892b017f2d |
| Transpilation MD5: | 876261cb570897d4dc9045e1ed77fbfe |
| Author: | stefan |
| Category: | javax / transpiling |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-02-07 19:46:09 |
| Source code size: | 543 bytes / 14 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 361 / 500 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |