On this page:
stubbed-components
start-console
start-console-here

5 Console🔗

 (require koyo/console) package: koyo-lib

parameter

(stubbed-components)  (listof symbol?)

(stubbed-components components)  void?
  components : (listof symbol?)
 = '(server)
The ids of components that start-console replaces with stubs when starting a system.

Added in version 0.28 of package koyo-lib.

procedure

(start-console dynamic-module-path    
  [namespace])  void?
  dynamic-module-path : path?
  namespace : namespace? = (make-base-empty-namespace)
Loads dynamic-module-path and starts its system, stubbing out any components whose ids are members of stubbed-components.

Use this procedure instead of start-console-here when you want to control the set of stubbed components. For example:

(require (prefix-in koyo: koyo/console) racket/path)
(define here (path-only (syntax-source #'here)))
(define dynamic.rkt (build-path here "dynamic.rkt"))
(define (start-console)
  (define ns (make-base-empty-namespace))
  (current-namespace ns)
  (koyo:stubbed-components '(server pubsub))
  (koyo:start-console dynamic.rkt ns))

Added in version 0.28 of package koyo-lib.

procedure

(start-console-here)  void?

Searches for the “dynamic.rkt” module in the current project starting from current-directory, then loads it and starts its system, stubbing out the server component. The search stops after looking through at most 10 directories or if a “.git” folder is found before a “dynamic.rkt” module. This is handy when you have an existing REPL session (eg. while working on a module in Emacs) and you want to bring in the functionality of raco koyo console into that session.

Requiring (submod koyo/console dev) is a shorthand for requiring this function and then calling it.

Added in version 0.9 of package koyo-lib.