# Exercise: File Reading Patterns
#
# Combine file operations for robust file handling:
#
# Pattern 1: Check then read
#   include std:control
#   "config.txt" file.exists? [
#       "config.txt" file.slurp process
#   ] when
#
# Pattern 2: Try-read with fallback
#   "config.txt" file.slurp-safe [
#       process
#   ] [
#       drop use-defaults
#   ] if
#
# Pattern 3: Process lines
#   "log.txt" [ handle-line ] file.for-each-line+
#
# Your task: Understand when to use each pattern
# When done, delete the marker line below.

# I AM NOT DONE

: safest-approach ( -- String )
    # Which is safer: "slurp" or "slurp-safe"?
    # (slurp-safe won't panic on missing files)
    ""
;

: test-combine ( -- )
    safest-approach
    # Do not edit below this line
    "slurp-safe" string.equal? test.assert
;
