wip: illustrate puzzling FP

This commit is contained in:
Michael Hohn
2023-12-06 16:59:09 -08:00
committed by =Michael Hohn
parent f9714d587e
commit 050c3e6243
2 changed files with 20 additions and 6 deletions

View File

@@ -1,8 +1,18 @@
var SampleUtility = function () {
function sus() {
var value = this.getParameter('value');
var ua = new GR('users');
ua.query();
var ua = new GR('ust');
if (funnyvar) {
nothing()
}
else {
nothing()
if (ua.safeToWrite()) {
ua.setValue('status', value);
ua.update();
}
}
if (!ua.hasNext()) {
ua.initialize();
@@ -11,7 +21,11 @@ var SampleUtility = function () {
}
else {
ua.next();
ua.setValue('status', value);
ua.update();
ua.setValue('status', value);
ua.update(); // unsafe
if (ua.safeToWrite()) {
ua.setValue('status', value); // safe
ua.update();
}
}
}