Libraryless. Click here for Pure Java version (2766L/18K).
sclass WaitForName { S question; persistently swappable S answer(S s) { if (isCancelCommand(s)) ret cancel(); S name = nameFromInput(s); if (name != null) { cancelSilently(); print("Processing name: " + quote(name)); ret processName(s); } ret otherInput(s); } persistently swappable S nameFromInput(S s) { ret s; } persistently swappable S otherInput(S s) { ret "I don't understand. " + question; } persistently swappable S processName(S name) { ret "You said: " + name; } persistently swappable bool isCancelCommand(S s) { ret match("cancel", s); } persistently swappable void cancelSilently() { print("Cancelling"); } persistently swappable S cancel() { cancelSilently(); ret "Action cancelled"; } }
Began life as a copy of #1027545
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027546 |
Snippet name: | WaitForName |
Eternal ID of this version: | #1027546/8 |
Text MD5: | 62d747184a7cd69fe0c60b242f36dada |
Transpilation MD5: | 728d11339bdd77a060b408d5cfa6a23f |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-03-23 15:50:41 |
Source code size: | 783 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 246 / 602 |
Version history: | 7 change(s) |
Referenced in: | #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674) |