Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1035390 // stepMaxWithPrintIndentedStruct

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9623L/56K).

svoid stepMaxWithPrintIndentedStruct(long maxSteps, Steppable s) {
  if (s == null) ret;
  S struct = null;
  long steps = 0;
  do {
    if (steps++ > maxSteps) break;
    print(struct = indentedStruct(s));
  } while (s.step());
  S struct2 = indentedStruct(s);
  if (!eq(struct, struct2)) print(struct2);
}

svoid stepMaxWithPrintIndentedStruct(Steppable s, long maxSteps) {
  stepMaxWithPrintIndentedStruct(maxSteps, s);
}

Author comment

Began life as a copy of #1035384

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035390
Snippet name: stepMaxWithPrintIndentedStruct
Eternal ID of this version: #1035390/3
Text MD5: f677da00d0c986f3f1a5328d1322a732
Transpilation MD5: c6f5ec4472a8d15a9f0d7e6d4677a6cb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-05 15:57:58
Source code size: 438 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 53 / 82
Version history: 2 change(s)
Referenced in: [show references]