live.ss
#lang scheme/base
(require
 "tools.ss")
(require/provide
 "live/tethered.ss"    ;; Scat code for host<->target interaction.
 "live/commands.ss"    ;; A target-local view to the above.
 "live/rpn-target.ss"  ;; Base implementation of the target command language.
 "live/reflection.ss"  ;; Namespace operations.
 "live/repl.ss"        ;; repl functionality

 ;; necessary for reflective operations to work:
; "target.ss"
; "ns.ss"
; "scat.ss"
 "macro.ss"
 )

(provide (all-defined-out))

;; (loading "live")

;; All uses of 'eval in the staapl/live/ modules will use the current
;; project namespace, as managed by prj/manager.ss code.  However,
;; live/commands.ss has a link to the manager for delegating
;; meta-namespace operations (like reload/switch/kill/...).


;; LIVE CONNECTION
(define (console spec)
  (with-handlers
      ((void (lambda _
               (printf "Can't open console ~a.\n*** Using simulator. ***\n" spec)
               (tethered-simulator))))
    (apply tethered-serial-port spec)
    (printf "Connected ~a\n" spec)
    ))