StructOp Handbook
Contents Examples Commands

Guestlist struct

Console program122 lines of .st142 lines of generated Rust
Program output
Hello, what's your name?
Hello Bert, enjoy your treehouse.
On this page

The .st files#

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

Input, plan and generated Rust#

input.txt · typed input (1 lines)
input.txt · typed input (1 lines)
Bert
structop plan
structop plan
  # program.app will be created
  + program.app (.structop/build/app)
      + ability.struct.Visitor
      + ability.function.greet_visitor
      + ability.print.Greeting
      + ability.function.what_is_your_name
      + ability.read_line.Line
      + ability.trim.Ends
      + ability.lower.Case
      + ability.print.Question
      + ability.call.GetName
      + ability.for.Find
      + ability.if.Same
      + ability.set.Found
      + ability.if.Match
      + ability.call.Greet
      + ability.print.Leave
      + ability.value.visitor_list
      + ability.value.name
      + ability.value.known_visitor
      + ability.value.i

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

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 rust-guestlist-struct    # a folder holding the .st files above
structop init
structop plan
structop apply < input.txt