# Exercise: Building a Prompt
#
# Interactive programs combine reading and writing.
#
# Pattern: Print prompt, read response, process
#
#   : get-name ( -- String )
#       "What is your name?" io.write-line
#       io.read-line
#   ;
#
#   : greet-user ( -- )
#       get-name
#       "Hello, " swap string.concat io.write-line
#   ;
#
# Your task: Design a simple prompt (conceptually).
#
# The test stubs out the read with a placeholder string, so it
# can't actually prompt you. The REPL also can't host an
# interactive prompt — it owns stdin itself. The friendly way is
# a shebang script you run directly from a terminal:
#
#   #!/usr/bin/env seqc
#
#   : main ( -- )
#       "What is your name? " io.write
#       io.read-line [ string.chomp "Hello, " swap string.concat io.write-line ]
#                    [ drop ] if
#   ;
#
#   $ chmod +x prompt.seq
#   $ ./prompt.seq
#   What is your name? Ed
#   Hello, Ed
#
# When done, delete the marker line below.

# I AM NOT DONE

: prompt-for ( String -- String )
    # Print the prompt string, then read input
    io.write-line
    # In real use: io.read-line
    "placeholder"   # For testing
;

: test-interactive ( -- )
    "Enter value: " prompt-for
    drop
    true test.assert
;
