StructOp Handbook
Contents Examples Commands

Prompt max bytes

Console program204 lines of .st427 lines of generated Cbuilds as C and Rust
Program output
Q0: 
0: [kept] 4
Q1: 
1: [aé] 3
Q2: 
2: [aa] 2
Q3: 
3: [é] 2
Q4: 
4: [abc] 3
Q5: 
5: [abc] 3
Q6: 
6: [kept] 4
Q7: 
7: [ab] 2
Q8: 
8: [kept] 4
On this page

The .st files#

intent.st
structop {
    type_app {
        exec = {
            lang = "C"
        }
    }

    lib_provider {
        core = {
            source  = "StructOp/core"
            version = "@latest"
        }
    }
}

Input, plan and generated C#

input.txt · typed input (9 lines)
input.txt · typed input (9 lines)
😀ab
aé
aaé
é
abc
abcd

a
b
structop plan
structop plan
  # program.app will be created
  + program.app (.structop/build/app)
      + ability.value.a0
      + ability.prompt.Q0
      + ability.print.O0
      + ability.value.a1
      + ability.prompt.Q1
      + ability.print.O1
      + ability.value.a2
      + ability.prompt.Q2
      + ability.print.O2
      + ability.value.a3
      + ability.prompt.Q3
      + ability.print.O3
      + ability.value.a4
      + ability.prompt.Q4
      + ability.print.O4
      + ability.value.a5
      + ability.prompt.Q5
      + ability.print.O5
      + ability.value.a6
      + ability.prompt.Q6
      + ability.print.O6
      + ability.value.a7
      + ability.prompt.Q7
      + ability.print.O7
      + ability.value.a8
      + ability.prompt.Q8
      + ability.print.O8

Plan: 1 to add, 0 to change, 0 to destroy.
Generated main.c

To inspect this generated file, select C in intent.st, initialize the project and export its source.

Export locally
structop init
structop apply -source -no-run
Generated main.rs (the same .st built as Rust)

To inspect this generated file, select Rust in intent.st, initialize the project and export its source.

Export locally
structop init
structop apply -source -no-run
Try it
cd prompt-max-bytes    # a folder holding the .st files above
structop init
structop plan
structop apply < input.txt